tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r550239 - in /tomcat/connectors/trunk/jk/native/common: jk_map.c jk_map.h jk_worker.c
Date Sun, 24 Jun 2007 14:51:45 GMT
Author: rjung
Date: Sun Jun 24 07:51:44 2007
New Revision: 550239

URL: http://svn.apache.org/viewvc?view=rev&rev=550239
Log:
Fix for r550203.
Also added some more debugging for the workers.properties
parsing.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_map.c
    tomcat/connectors/trunk/jk/native/common/jk_map.h
    tomcat/connectors/trunk/jk/native/common/jk_worker.c

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.c?view=diff&rev=550239&r1=550238&r2=550239
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.c Sun Jun 24 07:51:44 2007
@@ -418,7 +418,7 @@
     return JK_TRUE;
 }
 
-static int jk_map_handle_duplicates(jk_map_t *m, const char *prp, char *v,
+static int jk_map_handle_duplicates(jk_map_t *m, const char *prp, char **v,
                                     int treatment, jk_logger_t *l)
 {
     const char *oldv = jk_map_get_string(m, prp, NULL);
@@ -426,7 +426,7 @@
         if ((treatment == JK_MAP_HANDLE_DUPLICATES)
             && jk_is_unique_property(prp) == JK_FALSE) {
             char *tmpv = jk_pool_alloc(&m->p,
-                                       strlen(v) + strlen(oldv) + 3);
+                                       strlen(*v) + strlen(oldv) + 3);
             if (tmpv) {
                 char sep = '*';
                 if (jk_is_path_property(prp))
@@ -435,16 +435,20 @@
                     sep = ' ';
                 else if (jk_is_list_property(prp))
                     sep = ',';
-                sprintf(tmpv, "%s%c%s", oldv, sep, v);
+                sprintf(tmpv, "%s%c%s", oldv, sep, *v);
             }
-            v = tmpv;
+            *v = tmpv;
+            if (JK_IS_DEBUG_LEVEL(l))
+                jk_log(l, JK_LOG_DEBUG,
+                       "Concatenated value is: %s -> %s",
+                       prp, *v);
             return JK_FALSE;
         }
         else {
             jk_log(l, JK_LOG_WARNING,
                    "Duplicate key '%s' detected - previous value '%s'"
                    " will be overwritten with '%s'.",
-                   prp, oldv ? oldv : "(null)", v ? v : "(null)");
+                   prp, oldv ? oldv : "(null)", v ? *v : "(null)");
             return JK_TRUE;
         }
     }
@@ -483,10 +487,14 @@
                     if (jk_map_validate_property(prp, l) == JK_FALSE)
                         return JK_FALSE;
                     v = jk_map_replace_properties(m, v);
-                    if (jk_map_handle_duplicates(m, prp, v, treatment, l) == JK_TRUE)
+                    if (jk_map_handle_duplicates(m, prp, &v, treatment, l) == JK_TRUE)
                         v = jk_pool_strdup(&m->p, v);
                 }
                 if (v) {
+                    if (JK_IS_DEBUG_LEVEL(l))
+                        jk_log(l, JK_LOG_DEBUG,
+                               "Adding property '%s' with value '%s' to map.",
+                               prp, v);
                     jk_map_put(m, prp, v, NULL);
                 }
                 else {
@@ -564,6 +572,21 @@
     }
 
     return NULL;
+}
+
+void jk_map_dump(jk_map_t *m, jk_logger_t *l)
+{
+    if (m) {
+        if (JK_IS_DEBUG_LEVEL(l)) {
+            int s = jk_map_size(m);
+            int i;
+            for (i=0;i<s;i++) {
+                jk_log(l, JK_LOG_DEBUG,
+                       "Dump of map: '%s' -> '%s'",
+                       jk_map_name_at(m, i), jk_map_value_at(m, i));
+            }
+        }
+    }
 }
 
 static void trim_prp_comment(char *prp)

Modified: tomcat/connectors/trunk/jk/native/common/jk_map.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_map.h?view=diff&rev=550239&r1=550238&r2=550239
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_map.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_map.h Sun Jun 24 07:51:44 2007
@@ -80,6 +80,8 @@
 
 void *jk_map_value_at(jk_map_t *m, int idex);
 
+void jk_map_dump(jk_map_t *m, jk_logger_t *l);
+
 /**
  *  Replace $(property) in value.
  *

Modified: tomcat/connectors/trunk/jk/native/common/jk_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_worker.c?view=diff&rev=550239&r1=550238&r2=550239
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_worker.c Sun Jun 24 07:51:44 2007
@@ -62,6 +62,7 @@
         return JK_FALSE;
     }
 
+    jk_map_dump(init_data, l);
     if (!jk_get_worker_list(init_data, &(we->worker_list),
                             &we->num_of_workers)) {
         JK_TRACE_EXIT(l);



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


Mime
View raw message