--- loncom/lond 2004/02/24 16:53:16 1.179 +++ loncom/lond 2004/03/08 20:59:41 1.180 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.179 2004/02/24 16:53:16 albertel Exp $ +# $Id: lond,v 1.180 2004/03/08 20:59:41 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -53,7 +53,7 @@ my $DEBUG = 0; # Non zero to ena my $status=''; my $lastlog=''; -my $VERSION='$Revision: 1.179 $'; #' stupid emacs +my $VERSION='$Revision: 1.180 $'; #' stupid emacs my $remoteVERSION; my $currenthostid; my $currentdomainid; @@ -1258,8 +1258,18 @@ sub make_new_child { # the pid hash. # my $caller = getpeername($client); - my ($port,$iaddr)=unpack_sockaddr_in($caller); - $clientip=inet_ntoa($iaddr); + my ($port,$iaddr); + if (defined($caller) && length($caller) > 0) { + ($port,$iaddr)=unpack_sockaddr_in($caller); + } else { + &logthis("Unable to determine who caller was, getpeername returned nothing"); + } + if (defined($iaddr)) { + $clientip=inet_ntoa($iaddr); + } else { + &logthis("Unable to determine clinetip"); + $clientip='Unavailable'; + } if ($pid) { # Parent records the child's birth and returns.