--- loncom/Attic/lonc 2001/12/20 17:43:05 1.23 +++ loncom/Attic/lonc 2002/02/06 14:17:50 1.23.2.1 @@ -5,7 +5,7 @@ # provides persistent TCP connections to the other servers in the network # through multiplexed domain sockets # -# $Id: lonc,v 1.23 2001/12/20 17:43:05 harris41 Exp $ +# $Id: lonc,v 1.23.2.1 2002/02/06 14:17:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -570,14 +570,13 @@ while (1) { # Any complete requests to process? foreach $client (keys %ready) { - handle($client); + handle($client,$conserver); } # Buffers to flush? foreach $client ($select->can_write(1)) { # Skip this client if we have nothing to say next unless exists $outbuffer{$client}; - $rv = $client->send($outbuffer{$client}, 0); unless (defined $rv) { # Whine, but move on. @@ -607,7 +606,7 @@ while (1) { } } } - +} # ------------------------------------------------------- End of make_new_child # handle($socket) deals with all pending requests for $client @@ -615,6 +614,7 @@ sub handle { # requests are in $ready{$client} # send output to $outbuffer{$client} my $client = shift; + my $conserver = shift; my $request; foreach $request (@{$ready{$client}}) { @@ -641,10 +641,13 @@ sub handle { eval { alarm(300); &status("Sending $conserver: $request"); + &logthis("Sending $conserver: $request"); print $remotesock "$request"; &status("Waiting for reply from $conserver: $request"); + &logthis("Waiting for reply from $conserver: $request"); $answer=<$remotesock>; &status("Received reply: $request"); + &logthis("Received reply $conserver: $answer"); alarm(0); }; if ($@=~/timeout/) { @@ -675,13 +678,13 @@ sub handle { } # ===================================================== Done processing request + &logthis("Completed $conserver: $request"); } delete $ready{$client}; &status("Completed $conserver: $request"); # -------------------------------------------------------------- End non-forker } # ---------------------------------------------------------- End make_new_child -} # nonblock($socket) puts socket into nonblocking mode sub nonblock {