You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2006/07/08 10:15:45 UTC

svn commit: r420086 - /tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c

Author: mturk
Date: Sat Jul  8 01:15:44 2006
New Revision: 420086

URL: http://svn.apache.org/viewvc?rev=420086&view=rev
Log:
Close the socket even if the locking fails.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=420086&r1=420085&r2=420086&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Sat Jul  8 01:15:44 2006
@@ -740,11 +740,11 @@
     ajp_worker_t *aw = ae->worker;
     int sock = ae->sd;
 
+    /* Mark existing endpoint socket as closed */
+    ae->sd = -1;
     JK_ENTER_CS(&aw->cs, rc);
     if (rc) {
         unsigned int i;
-        /* Mark existing endpoint socket as closed */
-        ae->sd = -1;
         for (i = 0; i < aw->ep_cache_sz; i++) {
             /* Find cache slot with usable socket */
             if (aw->ep_cache[i] && aw->ep_cache[i]->sd != -1) {
@@ -754,9 +754,10 @@
             }
         }
         JK_LEAVE_CS(&aw->cs, rc);
-        /* Close previous socket */
-        jk_close_socket(sock);
     }
+    /* Close previous socket */
+    if (sock > 0)
+        jk_close_socket(sock);
 }
 
 /*
@@ -1781,7 +1782,9 @@
                        "Sending request to tomcat failed,  "
                        "recoverable operation attempt=%d", i + 1);
             }
-            /* Get another connection from the pool and try again */
+            /* Get another connection from the pool and try again.
+             * Note: All sockets are probably closed already.
+             */
             ajp_next_connection(p, l);
         }
         *is_error = JK_HTTP_SERVER_BUSY;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org