--- loncom/Attic/lonc 2003/08/29 18:25:01 1.54 +++ loncom/Attic/lonc 2003/09/17 19:05:03 1.55 @@ -5,7 +5,7 @@ # provides persistent TCP connections to the other servers in the network # through multiplexed domain sockets # -# $Id: lonc,v 1.54 2003/08/29 18:25:01 albertel Exp $ +# $Id: lonc,v 1.55 2003/09/17 19:05:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -361,13 +361,17 @@ while (1) { # accept a new connection &status("Accept new connection: $conserver"); $client = $server->accept(); - if($DEBUG) { - &logthis("New client fd = ".$client->fileno."\n"); + if (!$client) { + &logthis("Got stupid nonexisent client on ".$server->fileno." $conserver \n"); + } else { + if($DEBUG) { + &logthis("New client fd = ".$client->fileno."\n"); + } + $servers{$client->fileno} = $client; + nonblock($client); + $client->sockopt(SO_KEEPALIVE, 1); # Enable monitoring of + # connection liveness. } - $servers{$client->fileno} = $client; - nonblock($client); - $client->sockopt(SO_KEEPALIVE, 1);# Enable monitoring of - # connection liveness. } HandleInput($infdset, \%servers, \%inbuffer, \%outbuffer, \%ready); HandleOutput($outfdset, \%servers, \%outbuffer, \%inbuffer, @@ -988,12 +992,12 @@ sub londtransaction { alarm(0); }; } else { - &logthis("lonc - suiciding on send Timeout"); - die("lonc - suiciding on send Timeout"); + &logthis("lonc - $conserver - suiciding on send Timeout"); + die("lonc - $conserver - suiciding on send Timeout"); } if ($@ =~ /timeout/) { - &logthis("lonc - suiciding on read Timeout"); - die("lonc - suiciding on read Timeout"); + &logthis("lonc - $conserver - suiciding on read Timeout"); + die("lonc - $conserver - suiciding on read Timeout"); } # # Restore the initial sigmask set.