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 2008/01/20 13:35:07 UTC

svn commit: r613544 - in /tomcat/connectors/trunk/jk/native/common: jk_lb_worker.c jk_lb_worker.h jk_uri_worker_map.c

Author: rjung
Date: Sun Jan 20 04:35:06 2008
New Revision: 613544

URL: http://svn.apache.org/viewvc?rev=613544&view=rev
Log:
Add some warnings in extension parsing of uri worker
map (unknown extension, unknown lb member).
Start parsing at the first extension, not at the worker name.

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

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c?rev=613544&r1=613543&r2=613544&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.c Sun Jan 20 04:35:06 2008
@@ -219,6 +219,14 @@
 }
 
 /* Return the string representation of the balance worker activation */
+/* based on the integer representation */
+const char *jk_lb_get_activation_direct(int activation, jk_logger_t *l)
+{
+    return lb_activation_type[activation];
+}
+
+/* Return the string representation of the balance worker activation */
+/* based on the sub worker struct */
 const char *jk_lb_get_activation(lb_sub_worker_t *p, jk_logger_t *l)
 {
     return lb_activation_type[p->activation];

Modified: tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h?rev=613544&r1=613543&r2=613544&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Sun Jan 20 04:35:06 2008
@@ -205,6 +205,7 @@
 int jk_lb_get_method_code(const char *v);
 const char *jk_lb_get_state(lb_sub_worker_t *p, jk_logger_t *l);
 int jk_lb_get_state_code(const char *v);
+const char *jk_lb_get_activation_direct(int activation, jk_logger_t *l);
 const char *jk_lb_get_activation(lb_sub_worker_t *p, jk_logger_t *l);
 int jk_lb_get_activation_code(const char *v);
 void reset_lb_values(lb_worker_t *p, jk_logger_t *l);

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=613544&r1=613543&r2=613544&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 Jan 20 04:35:06 2008
@@ -369,9 +369,22 @@
     for (worker = strtok(workers, ", "); worker; worker = strtok(NULL, ", ")) {
 #endif
         for (i=0; i<lb->num_of_workers; i++) {
-            if (!strcmp(worker, lb->lb_workers[i].name))
+            if (!strcmp(worker, lb->lb_workers[i].name)) {
+                if (activations[i] != JK_LB_ACTIVATION_UNSET)
+                    jk_log(l, JK_LOG_WARNING,
+                           "inconsistent activation overwrite for member %s "
+                           "of load balancer %s: '%s' replaced by '%s'",
+                           worker, lb->name,
+                           jk_lb_get_activation_direct(activations[i], l),
+                           jk_lb_get_activation_direct(activation, l));
                 activations[i] = activation;
+                break;
+            }
         }
+        if (i >= lb->num_of_workers)
+            jk_log(l, JK_LOG_WARNING,
+                   "could not find member %s of load balancer %s",
+                   worker, lb->name);
     }
 
     JK_TRACE_EXIT(l);
@@ -525,9 +538,9 @@
 #endif
         if (param) {
 #ifdef _MT_CODE_PTHREAD
-            for (; param; param = strtok_r(NULL, ";", &lasts)) {
+            for (param = strtok_r(NULL, ";", &lasts); param; param = strtok_r(NULL, ";", &lasts)) {
 #else
-            for (; param; param = strtok(NULL, ";")) {
+            for (param = strtok(NULL, ";"); param; param = strtok(NULL, ";")) {
 #endif
                 if (!strncmp(param, JK_UWMAP_EXTENSION_REPLY_TIMEOUT, strlen(JK_UWMAP_EXTENSION_REPLY_TIMEOUT))) {
                     uwr->extensions.reply_timeout = atoi(param + strlen(JK_UWMAP_EXTENSION_REPLY_TIMEOUT));
@@ -555,6 +568,11 @@
                                JK_UWMAP_EXTENSION_STOPPED);
                     else
                         uwr->extensions.stopped = param + strlen(JK_UWMAP_EXTENSION_STOPPED);
+                }
+                else {
+                    jk_log(l, JK_LOG_WARNING,
+                           "unknown extension '%s' in uri worker map",
+                           param);
                 }
             }
         }



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