tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r1334395 - /tomcat/jk/trunk/native/common/jk_ajp_common.c
Date Sat, 05 May 2012 10:57:55 GMT
Author: mturk
Date: Sat May  5 10:57:55 2012
New Revision: 1334395

URL: http://svn.apache.org/viewvc?rev=1334395&view=rev
Log:
Make sure we have thread lock inside validate

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

Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1334395&r1=1334394&r2=1334395&view=diff
==============================================================================
--- tomcat/jk/trunk/native/common/jk_ajp_common.c (original)
+++ tomcat/jk/trunk/native/common/jk_ajp_common.c Sat May  5 10:57:55 2012
@@ -2937,16 +2937,6 @@ int ajp_init(jk_worker_t *pThis,
          *  of the following loop
          */
         p->secret = jk_get_worker_secret(props, p->name);
-        /* Initialize cache slots
-         */
-        JK_INIT_CS(&(p->cs), rc);
-        if (!rc) {
-            jk_log(l, JK_LOG_ERROR,
-                   "creating thread lock (errno=%d)",
-                   errno);
-            JK_TRACE_EXIT(l);
-            return JK_FALSE;
-        }
         if (!ajp_create_endpoint_cache(p, proto, l)) {
             jk_log(l, JK_LOG_ERROR,
                    "allocating connection pool of size %u",
@@ -2967,6 +2957,7 @@ int ajp_init(jk_worker_t *pThis,
 int JK_METHOD ajp_worker_factory(jk_worker_t **w,
                                  const char *name, jk_logger_t *l)
 {
+    int rc;
     ajp_worker_t *aw;
 
     JK_TRACE_ENTER(l);
@@ -3011,6 +3002,17 @@ int JK_METHOD ajp_worker_factory(jk_work
         JK_TRACE_EXIT(l);
         return JK_FALSE;
     }
+    JK_INIT_CS(&aw->cs, rc);
+    if (!rc) {
+        jk_log(l, JK_LOG_ERROR,
+               "creating thread lock (errno=%d)",
+               errno);
+        jk_close_pool(&aw->p);
+        free(aw);
+        JK_TRACE_EXIT(l);
+        return JK_FALSE;
+    }
+    
     JK_TRACE_EXIT(l);
     return JK_TRUE;
 }



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


Mime
View raw message