You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2007/09/30 22:35:38 UTC

svn commit: r580781 - /tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c

Author: rjung
Date: Sun Sep 30 13:35:38 2007
New Revision: 580781

URL: http://svn.apache.org/viewvc?rev=580781&view=rev
Log:
Add initialization of all struct members of
jk_uri_worker_map to uri_worker_map_alloc().
Add helper variable to remove lots of derefs.

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

Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c?rev=580781&r1=580780&r2=580781&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c Sun Sep 30 13:35:38 2007
@@ -176,16 +176,18 @@
     return (str[x] != '\0');
 }
 
-int uri_worker_map_alloc(jk_uri_worker_map_t **uw_map,
+int uri_worker_map_alloc(jk_uri_worker_map_t **uw_map_p,
                          jk_map_t *init_data, jk_logger_t *l)
 {
     JK_TRACE_ENTER(l);
 
-    if (uw_map) {
+    if (uw_map_p) {
         int rc;
-        *uw_map = (jk_uri_worker_map_t *)calloc(1, sizeof(jk_uri_worker_map_t));
+        jk_uri_worker_map_t *uw_map;
+        *uw_map_p = (jk_uri_worker_map_t *)calloc(1, sizeof(jk_uri_worker_map_t));
+        uw_map = *uw_map_p;
 
-        JK_INIT_CS(&((*uw_map)->cs), rc);
+        JK_INIT_CS(&(uw_map->cs), rc);
         if (rc == JK_FALSE) {
             jk_log(l, JK_LOG_ERROR,
                    "creating thread lock (errno=%d)",
@@ -194,14 +196,20 @@
             return JK_FALSE;
         }
 
-        jk_open_pool(&((*uw_map)->p),
-                     (*uw_map)->buf, sizeof(jk_pool_atom_t) * BIG_POOL_SIZE);
-        (*uw_map)->size = 0;
-        (*uw_map)->capacity = 0;
-        (*uw_map)->maps = NULL;
+        jk_open_pool(&(uw_map->p),
+                     uw_map->buf, sizeof(jk_pool_atom_t) * BIG_POOL_SIZE);
+        uw_map->size = 0;
+        uw_map->nosize = 0;
+        uw_map->capacity = 0;
+        uw_map->maps = NULL;
+        uw_map->fname = NULL;
+        uw_map->reject_unsafe = 0;
+        uw_map->reload = JK_URIMAP_DEF_RELOAD;
+        uw_map->modified = 0;
+        uw_map->checked = 0;
 
         if (init_data)
-            rc = uri_worker_map_open(*uw_map, init_data, l);
+            rc = uri_worker_map_open(uw_map, init_data, l);
         JK_TRACE_EXIT(l);
         return rc;
     }



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