[LON-CAPA-cvs] cvs: loncom / loncnew

foxr lon-capa-cvs@mail.lon-capa.org
Mon, 20 Sep 2004 10:27:35 -0000


foxr		Mon Sep 20 06:27:35 2004 EDT

  Modified files:              
    /loncom	loncnew 
  Log:
  - Fix a bit of an oops where I forgot to put a $ in front of a var.
  - Set up to only increase connection count if there are no connections
    in the process of being established... just need change one line to get there.
  
  
Index: loncom/loncnew
diff -u loncom/loncnew:1.53 loncom/loncnew:1.54
--- loncom/loncnew:1.53	Mon Sep 20 05:34:31 2004
+++ loncom/loncnew	Mon Sep 20 06:27:35 2004
@@ -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 $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 @@
 	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 @@
 		.$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 @@
 	}
 	Log("SUCESS", "Created connection ".$ConnectionCount
 	    ." to host ".GetServerHost());
+	$LondConnecting = 1;	# Connection in progress.
 	return 1;		# Return success.
     }
     
@@ -1238,7 +1244,7 @@
     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) {