log the IP address of the connecting client
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jul 2010 14:36:34 +0000 (14:36 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 23 Jul 2010 14:36:34 +0000 (14:36 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17021 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/marc_stream_importer.pl

index 07350e4..5f74e36 100755 (executable)
@@ -26,6 +26,7 @@ use File::Basename qw/fileparse/;
 use File::Temp;
 use Getopt::Long qw(:DEFAULT GetOptionsFromArray);
 use Pod::Usage;
+use Socket;
 
 use OpenSRF::Utils::Logger qw/$logger/;
 use OpenSRF::AppSession;
@@ -346,7 +347,9 @@ sub process_request {   # The core Net::Server method
     my $self = shift;
     my $client = $self->{server}->{client};
 
-    $logger->info("stream parser received contact from $client");
+    my $sockname = getpeername($client);
+    my ($port, $ip_addr) = unpack_sockaddr_in($sockname);
+    $logger->info("stream parser received contact from ".inet_ntoa($ip_addr));
 
     my $ph = OpenSRF::Transport::PeerHandle->retrieve;
     if(!$ph->flush_socket()) {