Author: rjung
Date: Sun Oct 23 19:05:16 2011
New Revision: 1187950

URL: http://svn.apache.org/viewvc?rev=1187950&view=rev
Log:
BZ 51743: HTTPD: Support rule extensions when defining
the request worker with an environment variable
(e.g. JK_WORKER_NAME).

Modified:
    tomcat/jk/trunk/native/apache-1.3/mod_jk.c
    tomcat/jk/trunk/native/apache-2.0/mod_jk.c
    tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
    tomcat/jk/trunk/xdocs/reference/apache.xml

Modified: tomcat/jk/trunk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-1.3/mod_jk.c?rev=1187950&r1=1187949&r2=1187950&view=diff
==============================================================================
--- tomcat/jk/trunk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/jk/trunk/native/apache-1.3/mod_jk.c Sun Oct 23 19:05:16 2011
@@ -2359,6 +2359,7 @@ static int jk_handler(request_rec * r)
                                                   module_config,
                                                   &jk_module);
     jk_request_conf_t *rconf;
+    int worker_name_extension = JK_FALSE;
 
     /* Retrieve the worker name stored by jk_translate() */
     const char *worker_name;
@@ -2395,6 +2396,16 @@ static int jk_handler(request_rec * r)
                 jk_log(conf->log, JK_LOG_DEBUG,
                        "Retrieved worker (%s) from env %s for %s",
                        worker_name, conf->worker_indicator, r->uri);
+            if (strchr(worker_name, ';')) {
+                rule_extension_t *e = ap_palloc(r->pool, 
sizeof(rule_extension_t));
+                char *w = ap_pstrdup(r->pool, worker_name);
+                worker_name_extension = JK_TRUE;
+                parse_rule_extensions(w, e, conf->log);
+                worker_name = w;
+                rconf = (jk_request_conf_t 
*)ap_get_module_config(r->request_config,
+                                                                  &jk_module);
+                rconf->rule_extensions = e;
+            }
         }
         else if (worker_env.num_of_workers == 1) {
           /* We have a single worker ( the common case ).
@@ -2462,6 +2473,11 @@ static int jk_handler(request_rec * r)
             private_data.read_body_started = JK_FALSE;
             private_data.r = r;
 
+            if (worker_name_extension == JK_TRUE) {
+                extension_fix(&private_data.p, worker_name,
+                              rconf->rule_extensions, conf->log);
+            }
+
             wc_maintain(conf->log);
             jk_init_ws_service(&s);
 

Modified: tomcat/jk/trunk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?rev=1187950&r1=1187949&r2=1187950&view=diff
==============================================================================
--- tomcat/jk/trunk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c Sun Oct 23 19:05:16 2011
@@ -2501,6 +2501,7 @@ static int jk_handler(request_rec * r)
     jk_server_conf_t *xconf;
     jk_request_conf_t *rconf;
     int rc, dmt = 1;
+    int worker_name_extension = JK_FALSE;
 
     /* We do DIR_MAGIC_TYPE here to make sure TC gets all requests, even
      * if they are directory requests, in case there are no static files
@@ -2547,6 +2548,16 @@ static int jk_handler(request_rec * r)
                 jk_log(xconf->log, JK_LOG_DEBUG,
                        "Retrieved worker (%s) from env %s for %s",
                        worker_name, xconf->worker_indicator, r->uri);
+            if (strchr(worker_name, ';')) {
+                rule_extension_t *e = apr_palloc(r->pool, 
sizeof(rule_extension_t));
+                char *w = apr_pstrdup(r->pool, worker_name);
+                worker_name_extension = JK_TRUE;
+                parse_rule_extensions(w, e, xconf->log);
+                worker_name = w;
+                rconf = (jk_request_conf_t 
*)ap_get_module_config(r->request_config,
+                                                                  &jk_module);
+                rconf->rule_extensions = e;
+            }
         }
         else if (worker_env.num_of_workers == 1) {
           /** We have a single worker ( the common case ).
@@ -2639,6 +2650,11 @@ static int jk_handler(request_rec * r)
             private_data.read_body_started = JK_FALSE;
             private_data.r = r;
 
+            if (worker_name_extension == JK_TRUE) {
+                extension_fix(&private_data.p, worker_name,
+                              rconf->rule_extensions, xconf->log);
+            }
+
             /* Maintain will be done by watchdog thread */
             if (!jk_watchdog_interval)
                 wc_maintain(xconf->log);

Modified: tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml?rev=1187950&r1=1187949&r2=1187950&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/jk/trunk/xdocs/miscellaneous/changelog.xml Sun Oct 23 19:05:16 2011
@@ -44,6 +44,11 @@
   <br />
   <subsection name="Native">
     <changelog>
+      <add>
+        <bug>51743</bug>: HTTPD: Support rule extensions when defining
+        the request worker with an environment variable
+        (e.g. JK_WORKER_NAME). (rjung)
+      </add>
       <fix>
         <bug>51769</bug>: IIS: Allow URIs which contain "META-INF" or
         "WEB-INF" as long as they are not path components of the URI. (rjung)

Modified: tomcat/jk/trunk/xdocs/reference/apache.xml
URL: 
http://svn.apache.org/viewvc/tomcat/jk/trunk/xdocs/reference/apache.xml?rev=1187950&r1=1187949&r2=1187950&view=diff
==============================================================================
--- tomcat/jk/trunk/xdocs/reference/apache.xml (original)
+++ tomcat/jk/trunk/xdocs/reference/apache.xml Sun Oct 23 19:05:16 2011
@@ -1086,7 +1086,11 @@ In order to control the worker using <b>
 for more complex rules, you can set the environment variable 
<b>JK_WORKER_NAME</b>
 to the name of your chosen target worker. This enables you to decide on
 the chosen worker in a more flexible way, including dependencies on cookie 
values.
-This feature has been added in version 1.2.19 of mod_jk.
+This feature has been added in version 1.2.19 of mod_jk. Furthermore you might
+include rule extensions in the worker name. The extensions are separated from 
the
+worker name by a semicolon ";" using the same syntax as in the
+uriworkermap.properties file. Supporting rule extensions in the worker name has
+been added in version 1.2.33.
 </p>
 <p>
 In order to use another variable than <b>JK_WORKER_NAME</b>, you can set the 
name



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to