--- loncom/loncnew 2004/09/20 09:34:31 1.53 +++ loncom/loncnew 2004/09/20 10:27:35 1.54 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # lonc maintains the connections to remote computers # -# $Id: loncnew,v 1.53 2004/09/20 09:34:31 foxr Exp $ +# $Id: loncnew,v 1.54 2004/09/20 10:27:35 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -104,6 +104,7 @@ my $ConnectionRetries=2; # Number of con my $ConnectionRetriesLeft=2; # Number of connection retries remaining. my $LondVersion = "unknown"; # Version of lond we talk with. my $KeyMode = ""; # e.g. ssl, local, insecure from last connect. +my $LondConnecting = 0; # True when a connection is being built. # # The hash below gives the HTML format for log messages @@ -310,7 +311,7 @@ sub Tick { if($IdleSeconds > $IdleTimeout) { # Prune a connection... my $Socket = $IdleConnections->pop(); KillSocket($Socket); - IdleSeconds = 0; # Otherwise all connections get trimmed to fast. + $IdleSeconds = 0; # Otherwise all connections get trimmed to fast. } } else { $IdleSeconds = 0; # Reset idle count if not idle. @@ -872,6 +873,10 @@ sub LondReadable { .$RemoteHost." now ready for action"); } ServerToIdle($Socket); # Next work unit or idle. + + # + $LondConnecting = 0; # Best spot I can think of for this. + # } elsif ($State eq "SendingRequest") { # We need to be writable for this and probably don't belong @@ -1155,6 +1160,7 @@ sub MakeLondConnection { } Log("SUCESS", "Created connection ".$ConnectionCount ." to host ".GetServerHost()); + $LondConnecting = 1; # Connection in progress. return 1; # Return success. } @@ -1238,7 +1244,7 @@ sub QueueTransaction { if(!defined $LondSocket) { # Need to queue request. Debug(5,"Must queue..."); $WorkQueue->enqueue($requestData); - if($ConnectionCount < $MaxConnectionCount) { + if(($ConnectionCount < $MaxConnectionCount)) { # && !$LondConnecting) { if($ConnectionRetriesLeft > 0) { Debug(5,"Starting additional lond connection"); if(MakeLondConnection() == 0) {