Author: mturk
Date: Wed Oct  1 07:50:03 2008
New Revision: 700797

URL: http://svn.apache.org/viewvc?rev=700797&view=rev
Log:
Update map_uri_to_worker_ext API so we can get extensions for server that have 
no request processing configuration API. For IIS we'll set the Index of 
worker_map to private header and pass that to extension processing stage

Modified:
    tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
    tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
    tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h

Modified: tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c?rev=700797&r1=700796&r2=700797&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-1.3/mod_jk.c Wed Oct  1 07:50:03 
2008
@@ -2786,7 +2786,7 @@
             else {
                 rule_extension_t *e;
                 worker = map_uri_to_worker_ext(conf->uw_map, clean_uri,
-                                               NULL, &e, conf->log);
+                                               NULL, &e, NULL, conf->log);
                 ap_set_module_config(r->request_config, &jk_module, e);
             }
 

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=700797&r1=700796&r2=700797&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Wed Oct  1 07:50:03 
2008
@@ -2281,7 +2281,7 @@
             else {
                 rule_extension_t *e;
                 worker_name = map_uri_to_worker_ext(xconf->uw_map, r->uri,
-                                                    NULL, &e, xconf->log);
+                                                    NULL, &e, NULL, 
xconf->log);
                 ap_set_module_config(r->request_config, &jk_module, e);
             }
 
@@ -3217,7 +3217,7 @@
             else {
                 rule_extension_t *e;
                 worker = map_uri_to_worker_ext(conf->uw_map, r->uri,
-                                               NULL, &e, conf->log);
+                                               NULL, &e, NULL, conf->log);
                 ap_set_module_config(r->request_config, &jk_module, e);
             }
 
@@ -3377,7 +3377,7 @@
             else {
                 rule_extension_t *e;
                 worker = map_uri_to_worker_ext(conf->uw_map, r->uri,
-                                               NULL, &e, conf->log);
+                                               NULL, &e, NULL, conf->log);
                 ap_set_module_config(r->request_config, &jk_module, e);
             }
 

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=700797&r1=700796&r2=700797&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 Wed Oct  1 
07:50:03 2008
@@ -876,6 +876,7 @@
 const char *map_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
                                   const char *uri, const char *vhost,
                                   rule_extension_t **extensions,
+                                  int *index,
                                   jk_logger_t *l)
 {
     unsigned int i;
@@ -892,6 +893,8 @@
         return NULL;
     }
     *extensions = NULL;
+    if (index)
+        *index = -1;
     if (*uri != '/') {
         jk_log(l, JK_LOG_WARNING,
                 "Uri %s is invalid. Uri must start with /", uri);
@@ -913,19 +916,19 @@
      */
     reject_unsafe = uw_map->reject_unsafe;
     vhost_len = 0;
-/*
- * In case we got a vhost, we prepend a slash
- * and the vhost to the url in order to enable
- * vhost mapping rules especially for IIS.
- */
+    /*
+     * In case we got a vhost, we prepend a slash
+     * and the vhost to the url in order to enable
+     * vhost mapping rules especially for IIS.
+     */
     if (vhost) {
         int off = 0;
-/* Add leading '/' if necessary */
+        /* Add leading '/' if necessary */
         if (vhost[0] != '/') {
             url[0] = '/';
             off = 1;
         }
-/* Size including leading slash. */
+        /* Size including leading slash. */
         vhost_len = strlen(vhost);
         if (vhost_len + off >= JK_MAX_URI_LEN) {
             vhost_len = 0;
@@ -970,16 +973,16 @@
         jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s' from %d maps",
                url, IND_THIS(uw_map->size));
     rv = find_match(uw_map, url, l);
-/* If this doesn't find a match, try without the vhost. */
+    /* If this doesn't find a match, try without the vhost. */
     if (rv < 0 && vhost_len) {
         rv = find_match(uw_map, &url[vhost_len], l);
     }
 
-/* In case we found a match, check for the unmounts. */
+    /* In case we found a match, check for the unmounts. */
     if (rv >= 0 && IND_THIS(uw_map->nosize)) {
-/* Again first including vhost. */
+        /* Again first including vhost. */
         int rc = is_nomatch(uw_map, url, rv, l);
-/* If no unmount was find, try without vhost. */
+        /* If no unmount was find, try without vhost. */
         if (!rc && vhost_len)
             rc = is_nomatch(uw_map, &url[vhost_len], rv, l);
         if (rc) {
@@ -994,6 +997,8 @@
 
     if (rv >= 0) {
         *extensions = &(IND_THIS(uw_map->maps)[rv]->extensions);
+        if (index)
+            *index = rv;
         JK_TRACE_EXIT(l);
         return IND_THIS(uw_map->maps)[rv]->worker_name;
     }
@@ -1001,12 +1006,23 @@
     return NULL;
 }
 
+rule_extension_t *get_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
+                                        int index)
+{
+    if (rv >= 0) {
+        return &(IND_THIS(uw_map->maps)[rv]->extensions);
+    }
+    else {
+        return NULL;
+    }
+}
+
 const char *map_uri_to_worker(jk_uri_worker_map_t *uw_map,
                               const char *uri, const char *vhost,
                               jk_logger_t *l)
 {
     rule_extension_t *ext;
-    return map_uri_to_worker_ext(uw_map, uri, vhost, &ext, l);
+    return map_uri_to_worker_do(uw_map, uri, vhost, &ext, NULL, l);
 }
 
 int uri_worker_map_load(jk_uri_worker_map_t *uw_map,

Modified: tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h
URL: 
http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h?rev=700797&r1=700796&r2=700797&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h Wed Oct  1 
07:50:03 2008
@@ -188,8 +188,12 @@
 const char *map_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
                                   const char *uri, const char *vhost,
                                   rule_extension_t **extensions,
+                                  int *index,
                                   jk_logger_t *l);
 
+rule_extension_t *get_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
+                                        int index);
+
 int uri_worker_map_load(jk_uri_worker_map_t *uw_map,
                         jk_logger_t *l);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to