tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r613274 - in /tomcat/connectors/trunk/jk/native: apache-1.3/ apache-2.0/ common/ iis/
Date Fri, 18 Jan 2008 21:14:25 GMT
Author: rjung
Date: Fri Jan 18 13:14:24 2008
New Revision: 613274

URL: http://svn.apache.org/viewvc?rev=613274&view=rev
Log:
Add extension attribute parsing to uri worker map.
First uses are reply_timeout and activation status per mount.
Usage currently only implemented for httpd, IIS to follow.

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_ajp_common.c
    tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h
    tomcat/connectors/trunk/jk/native/common/jk_service.h
    tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.c
    tomcat/connectors/trunk/jk/native/common/jk_uri_worker_map.h
    tomcat/connectors/trunk/jk/native/common/jk_util.c
    tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c

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=613274&r1=613273&r2=613274&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 Fri Jan 18 13:14:24 2008
@@ -612,6 +612,7 @@
     request_rec *r = private_data->r;
     char *ssl_temp = NULL;
     const char *reply_timeout = NULL;
+    rule_extension_t *e;
 
     /* Copy in function pointers (which are really methods) */
     s->start_response = ws_start_response;
@@ -642,9 +643,20 @@
     if (conf->options & JK_OPT_FLUSHEADER)
         s->flush_header = 1;
 
+    e = (rule_extension_t *)ap_get_module_config(r->request_config, &jk_module);
+    if (e) {
+        s->extension.reply_timeout = e->reply_timeout;
+        if (e->activation) {
+            s->extension.activation = ap_palloc(r->pool, e->size * sizeof(int));
+            memcpy(s->extension.activation, e->activation, e->size * sizeof(int));
+        }
+    }
     reply_timeout = ap_table_get(r->subprocess_env, "JK_REPLY_TIMEOUT");
-    if (reply_timeout)
-        s->reply_timeout = atoi(reply_timeout);
+    if (reply_timeout) {
+        int r = atoi(reply_timeout);
+        if (r >= 0)
+            s->extension.reply_timeout = r;
+    }
 
     if (conf->options & JK_OPT_DISABLEREUSE)
         s->disable_reuse = 1;
@@ -2712,6 +2724,13 @@
                       "Error in creating the workers."
                       " Please consult your mod_jk log file '%s'.", conf->log_file);
     }
+    uri_worker_map_ext(conf->uw_map, conf->log);
+    for (srv = s; srv; srv = srv->next) {
+        jk_server_conf_t *sconf = (jk_server_conf_t *)ap_get_module_config(srv->module_config,
+                                                                           &jk_module);
+        if (conf->uw_map != sconf->uw_map)
+            uri_worker_map_ext(sconf->uw_map, sconf->log);
+    }
 
 }
 
@@ -2722,6 +2741,10 @@
  */
 static int jk_translate(request_rec * r)
 {
+    rule_extension_t **ext = ap_palloc(r->pool, sizeof(rule_extension_t *));
+    *ext = NULL;
+    ap_set_module_config(r->request_config, &jk_module, ext);
+
     if (!r->proxyreq) {
         jk_server_conf_t *conf =
             (jk_server_conf_t *) ap_get_module_config(r->server->
@@ -2749,9 +2772,12 @@
                            r->uri);
                 return DECLINED;
             }
-            else
-                worker = map_uri_to_worker(conf->uw_map, clean_uri,
-                                           NULL, conf->log);
+            else {
+                rule_extension_t *e;
+                worker = map_uri_to_worker_ext(conf->uw_map, clean_uri,
+                                               NULL, &e, conf->log);
+                ap_set_module_config(r->request_config, &jk_module, e);
+            }
 
             /* Don't know the worker, ForwardDirectories is set, there is a
              * previous request for which the handler is JK_HANDLER (as set by

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=613274&r1=613273&r2=613274&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 Fri Jan 18 13:14:24 2008
@@ -626,6 +626,7 @@
     request_rec *r = private_data->r;
     char *ssl_temp = NULL;
     const char *reply_timeout = NULL;
+    rule_extension_t *e;
 
     /* Copy in function pointers (which are really methods) */
     s->start_response = ws_start_response;
@@ -654,9 +655,20 @@
     if (conf->options & JK_OPT_FLUSHEADER)
         s->flush_header = 1;
 
+    e = (rule_extension_t *)ap_get_module_config(r->request_config, &jk_module);
+    if (e) {
+        s->extension.reply_timeout = e->reply_timeout;
+        if (e->activation) {
+            s->extension.activation = apr_palloc(r->pool, e->size * sizeof(int));
+            memcpy(s->extension.activation, e->activation, e->size * sizeof(int));
+        }
+    }
     reply_timeout = apr_table_get(r->subprocess_env, "JK_REPLY_TIMEOUT");
-    if (reply_timeout)
-        s->reply_timeout = atoi(reply_timeout);
+    if (reply_timeout) {
+        int r = atoi(reply_timeout);
+        if (r >= 0)
+            s->extension.reply_timeout = r;
+    }
 
     if (conf->options & JK_OPT_DISABLEREUSE)
         s->disable_reuse = 1;
@@ -2196,9 +2208,12 @@
                            xconf->s->server_hostname ? xconf->s->server_hostname
: "_default_",
                            r->uri);
             }
-            else
-                worker_name = map_uri_to_worker(xconf->uw_map, r->uri,
-                                                NULL, xconf->log);
+            else {
+                rule_extension_t *e;
+                worker_name = map_uri_to_worker_ext(xconf->uw_map, r->uri,
+                                                    NULL, &e, xconf->log);
+                ap_set_module_config(r->request_config, &jk_module, e);
+            }
 
             if (worker_name == NULL && worker_env.num_of_workers) {
                 worker_name = worker_env.worker_list[0];
@@ -2951,6 +2966,14 @@
             conf->was_initialized = JK_TRUE;
             if (init_jk(pconf, conf, s) == JK_FALSE)
                 return HTTP_INTERNAL_SERVER_ERROR;
+            uri_worker_map_ext(conf->uw_map, conf->log);
+            for (srv = s; srv; srv = srv->next) {
+                jk_server_conf_t *sconf = (jk_server_conf_t *)ap_get_module_config(srv->module_config,
+                                                                                   &jk_module);
+                if (conf->uw_map != sconf->uw_map)
+                    uri_worker_map_ext(sconf->uw_map, sconf->log);
+            }
+
         }
     }
 
@@ -2962,6 +2985,10 @@
  */
 static int jk_translate(request_rec * r)
 {
+    rule_extension_t **ext = apr_palloc(r->pool, sizeof(rule_extension_t *));
+    *ext = NULL;
+    ap_set_module_config(r->request_config, &jk_module, ext);
+
     if (!r->proxyreq) {
         jk_server_conf_t *conf =
             (jk_server_conf_t *) ap_get_module_config(r->server->
@@ -3032,9 +3059,12 @@
                            r->uri);
                 return DECLINED;
             }
-            else
-                worker = map_uri_to_worker(conf->uw_map, r->uri,
-                                           NULL, conf->log);
+            else {
+                rule_extension_t *e;
+                worker = map_uri_to_worker_ext(conf->uw_map, r->uri,
+                                               NULL, &e, conf->log);
+                ap_set_module_config(r->request_config, &jk_module, e);
+            }
 
             if (worker) {
                 r->handler = apr_pstrdup(r->pool, JK_HANDLER);
@@ -3189,9 +3219,12 @@
                            r->uri);
                 return DECLINED;
             }
-            else
-                worker = map_uri_to_worker(conf->uw_map, r->uri,
-                                           NULL, conf->log);
+            else {
+                rule_extension_t *e;
+                worker = map_uri_to_worker_ext(conf->uw_map, r->uri,
+                                               NULL, &e, conf->log);
+                ap_set_module_config(r->request_config, &jk_module, e);
+            }
 
             if (worker) {
                 r->handler = apr_pstrdup(r->pool, JK_HANDLER);

Modified: tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c?rev=613274&r1=613273&r2=613274&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_ajp_common.c Fri Jan 18 13:14:24 2008
@@ -1816,8 +1816,7 @@
     while (1) {
         int rc = 0;
         /* Allow to overwrite reply_timeout on a per URL basis via service struct */
-        int reply_timeout = s->reply_timeout;
-
+        int reply_timeout = s->extension.reply_timeout;
         if (reply_timeout < 0)
             reply_timeout = p->worker->reply_timeout;
         /* If we set a reply timeout, check if something is available */

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=613274&r1=613273&r2=613274&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_lb_worker.h Fri Jan 18 13:14:24 2008
@@ -82,6 +82,11 @@
 #define JK_LB_STATE_TEXT_PROBE         ("ERR/PRB")
 #define JK_LB_STATE_TEXT_MAX           (JK_LB_STATE_PROBE)
 #define JK_LB_STATE_TEXT_DEF           (JK_LB_STATE_TEXT_IDLE)
+/* JK_LB_ACTIVATION_UNSET is not allowed as an actual worker state. */
+/* It will not work e.g. when the status worker tries to show the state. */
+/* It is only used in rule extension data to indicate, that the */
+/* activation state should not be overwritten. */
+#define JK_LB_ACTIVATION_UNSET         (-1)
 #define JK_LB_ACTIVATION_ACTIVE        (0)
 #define JK_LB_ACTIVATION_DISABLED      (1)
 #define JK_LB_ACTIVATION_STOPPED       (2)

Modified: tomcat/connectors/trunk/jk/native/common/jk_service.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_service.h?rev=613274&r1=613273&r2=613274&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_service.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_service.h Fri Jan 18 13:14:24 2008
@@ -75,6 +75,16 @@
 typedef struct jk_endpoint jk_endpoint_t;
 typedef struct jk_worker jk_worker_t;
 
+struct svc_extension
+{
+    /* reply_timeout overwrite */
+    int reply_timeout;
+    /* activation state overwrites for load balancers */
+    /* Dynamically allocated array with one entry per lb member. */
+    int *activation;
+};
+typedef struct svc_extension svc_extension_t;
+
 /*
  * The web server service 'class'.  An instance of this class is created
  * for each request which is forwarded from the web server to the servlet
@@ -222,9 +232,9 @@
     int flush_header;
 
     /*
-     * If >= 0, overwrite the worker reply_timeout
+     * service extensions
      */
-    int reply_timeout;
+    svc_extension_t extension;
 
     /*
      * JK_TRUE if response headers have been sent back

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=613274&r1=613273&r2=613274&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 Fri Jan 18 13:14:24 2008
@@ -28,6 +28,8 @@
 #include "jk_map.h"
 #include "jk_mt.h"
 #include "jk_uri_worker_map.h"
+#include "jk_worker.h"
+#include "jk_lb_worker.h"
 
 #ifdef WIN32
 #define JK_STRCMP   strcasecmp
@@ -37,6 +39,11 @@
 #define JK_STRNCMP  strncmp
 #endif
 
+#define JK_UWMAP_EXTENSION_REPLY_TIMEOUT "reply_timeout="
+#define JK_UWMAP_EXTENSION_ACTIVE        "active="
+#define JK_UWMAP_EXTENSION_DISABLE       "disable="
+#define JK_UWMAP_EXTENSION_STOP          "stop="
+
 #define IND_THIS(x)                        ((x)[uw_map->index])
 #define IND_NEXT(x)                        ((x)[(uw_map->index+1) % 2])
 
@@ -341,6 +348,112 @@
     return JK_TRUE;
 }
 
+static void extract_activation(lb_worker_t *lb,
+                               int *activations,
+                               char *workers,
+                               int activation,
+                               jk_logger_t *l)
+{
+    int i;
+    char *worker;
+#ifdef _MT_CODE_PTHREAD
+    char *lasts;
+#endif
+
+    JK_TRACE_ENTER(l);
+
+#ifdef _MT_CODE_PTHREAD
+    for (worker = strtok_r(workers, ",", &lasts);
+         worker; worker = strtok_r(NULL, "&", &lasts)) {
+#else
+    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))
+                activations[i] = activation;
+        }
+    }
+
+    JK_TRACE_EXIT(l);
+
+}
+
+void uri_worker_map_ext(jk_uri_worker_map_t *uw_map, jk_logger_t *l)
+{
+    unsigned int i;
+
+    JK_TRACE_ENTER(l);
+
+    for (i = 0; i < IND_NEXT(uw_map->size); i++) {
+        uri_worker_record_t *uwr = IND_NEXT(uw_map->maps)[i];
+        jk_worker_t *jw = wc_get_worker_for_name(uwr->worker_name, l);
+        if (JK_IS_DEBUG_LEVEL(l))
+            jk_log(l, JK_LOG_DEBUG,
+                   "Checking extension for worker %d: %s of type %s (%d)",
+                   i, uwr->worker_name, wc_get_name_for_type(jw->type,l), jw->type);
+
+        if (jw->type == JK_LB_WORKER_TYPE &&
+            (uwr->extensions.active || uwr->extensions.disable || uwr->extensions.stop))
{
+            int j;
+            lb_worker_t *lb = (lb_worker_t *)jw->worker_private;
+            jk_pool_t *p;
+            if (!uwr->extensions.activation) {
+                uwr->extensions.size = lb->num_of_workers;
+                if (uwr->source_type == SOURCE_TYPE_URIMAP)
+                    p = &IND_NEXT(uw_map->p_dyn);
+                else
+                    p = &uw_map->p;
+                uwr->extensions.activation = (int *)jk_pool_alloc(p,
+                                                        uwr->extensions.size * sizeof(int));
+                if (!uwr->extensions.activation) {
+                    jk_log(l, JK_LOG_ERROR,
+                           "can't alloc extensions activation list");
+                    continue;
+                } else if (JK_IS_DEBUG_LEVEL(l))
+                    jk_log(l, JK_LOG_DEBUG,
+                           "Allocated activations array of size %d for lb worker %s",
+                           uwr->extensions.size, uwr->worker_name);
+                for (j=0; j<uwr->extensions.size; j++) {
+                    uwr->extensions.activation[j] = JK_LB_ACTIVATION_UNSET;
+                }
+            }
+            if (uwr->extensions.active)
+                extract_activation(lb, uwr->extensions.activation,
+                                   uwr->extensions.active, JK_LB_ACTIVATION_ACTIVE, l);
+            if (uwr->extensions.disable)
+                extract_activation(lb, uwr->extensions.activation,
+                                   uwr->extensions.disable, JK_LB_ACTIVATION_DISABLED,
l);
+            if (uwr->extensions.stop)
+                extract_activation(lb, uwr->extensions.activation,
+                                   uwr->extensions.stop, JK_LB_ACTIVATION_STOPPED, l);
+        }
+        else if (uwr->extensions.active) {
+            jk_log(l, JK_LOG_WARNING,
+                   "Worker %s is not of type lb, activation extension "
+                   JK_UWMAP_EXTENSION_ACTIVE " for %s ignored",
+                   uwr->worker_name, uwr->extensions.active);
+        }
+        else if (uwr->extensions.disable) {
+            jk_log(l, JK_LOG_WARNING,
+                   "Worker %s is not of type lb, activation extension "
+                   JK_UWMAP_EXTENSION_DISABLE " for %s ignored",
+                   uwr->worker_name, uwr->extensions.disable);
+        }
+        else if (uwr->extensions.stop) {
+            jk_log(l, JK_LOG_WARNING,
+                   "Worker %s is not of type lb, activation extension "
+                   JK_UWMAP_EXTENSION_STOP " for %s ignored",
+                   uwr->worker_name, uwr->extensions.stop);
+        }
+    }
+    uw_map->index = (uw_map->index + 1) % 2;
+    jk_reset_pool(&(IND_NEXT(uw_map->p_dyn)));
+
+    JK_TRACE_EXIT(l);
+    return;
+
+}
+
 int uri_worker_map_add(jk_uri_worker_map_t *uw_map,
                        const char *puri, const char *worker,
                        unsigned int source_type, jk_logger_t *l)
@@ -391,11 +504,63 @@
     }
 
     if (*uri == '/') {
+        char *w;
+        char *param;
+#ifdef _MT_CODE_PTHREAD
+        char *lasts;
+#endif
+
+        w = jk_pool_strdup(p, worker);
+        uwr->extensions.reply_timeout = -1;
+        uwr->extensions.active = NULL;
+        uwr->extensions.disable = NULL;
+        uwr->extensions.stop = NULL;
+        uwr->extensions.size = 0;
+        uwr->extensions.activation = NULL;
+
+#ifdef _MT_CODE_PTHREAD
+        param = strtok_r(w, ";", &lasts);
+#else
+        param = strtok(w, ";");
+#endif
+        if (param) {
+#ifdef _MT_CODE_PTHREAD
+            for (; param; param = strtok_r(NULL, ";", &lasts)) {
+#else
+            for (; 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));
+                }
+                else if (!strncmp(param, JK_UWMAP_EXTENSION_ACTIVE, strlen(JK_UWMAP_EXTENSION_ACTIVE)))
{
+                    if (uwr->extensions.active)
+                        jk_log(l, JK_LOG_WARNING,
+                               "active extension in uriworker map only allowed once");
+                    else
+                        uwr->extensions.active = param + strlen(JK_UWMAP_EXTENSION_ACTIVE);
+                }
+                else if (!strncmp(param, JK_UWMAP_EXTENSION_DISABLE, strlen(JK_UWMAP_EXTENSION_DISABLE)))
{
+                    if (uwr->extensions.disable)
+                        jk_log(l, JK_LOG_WARNING,
+                               "disable extension in uriworker map only allowed once");
+                    else
+                        uwr->extensions.disable = param + strlen(JK_UWMAP_EXTENSION_DISABLE);
+                }
+                else if (!strncmp(param, JK_UWMAP_EXTENSION_STOP, strlen(JK_UWMAP_EXTENSION_STOP)))
{
+                    if (uwr->extensions.stop)
+                        jk_log(l, JK_LOG_WARNING,
+                               "stop extension in uriworker map only allowed once");
+                    else
+                        uwr->extensions.stop = param + strlen(JK_UWMAP_EXTENSION_STOP);
+                }
+            }
+        }
+
+        uwr->source_type = source_type;
+        uwr->worker_name = w;
         uwr->uri = uri;
         uwr->context = uri;
-        uwr->worker_name = jk_pool_strdup(p, worker);
         uwr->context_len = strlen(uwr->context);
-        uwr->source_type = source_type;
         if (strchr(uri, '*') ||
             strchr(uri, '?')) {
             /* Something like
@@ -620,9 +785,10 @@
     return JK_FALSE;
 }
 
-const char *map_uri_to_worker(jk_uri_worker_map_t *uw_map,
-                              const char *uri, const char *vhost,
-                              jk_logger_t *l)
+const char *map_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
+                                  const char *uri, const char *vhost,
+                                  rule_extension_t **extensions,
+                                  jk_logger_t *l)
 {
     unsigned int i;
     unsigned int vhost_len;
@@ -632,11 +798,12 @@
 
     JK_TRACE_ENTER(l);
 
-    if (!uw_map || !uri) {
+    if (!uw_map || !uri || !extensions) {
         JK_LOG_NULL_PARAMS(l);
         JK_TRACE_EXIT(l);
         return NULL;
     }
+    *extensions = NULL;
     if (*uri != '/') {
         jk_log(l, JK_LOG_WARNING,
                 "Uri %s is invalid. Uri must start with /", uri);
@@ -738,6 +905,7 @@
     }
 
     if (rv >= 0) {
+        *extensions = &(IND_THIS(uw_map->maps)[rv]->extensions);
         JK_TRACE_EXIT(l);
         return IND_THIS(uw_map->maps)[rv]->worker_name;
     }
@@ -745,6 +913,14 @@
     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);
+}
+
 int uri_worker_map_load(jk_uri_worker_map_t *uw_map,
                         jk_logger_t *l)
 {
@@ -799,8 +975,6 @@
         rc = JK_TRUE;
     }
     jk_map_free(&map);
-    uw_map->index = (uw_map->index + 1) % 2;
-    jk_reset_pool(&(IND_NEXT(uw_map->p_dyn)));
     return rc;
 }
 
@@ -838,6 +1012,7 @@
             return JK_TRUE;
         }
         rc = uri_worker_map_load(uw_map, l);
+        uri_worker_map_ext(uw_map, l);
         JK_LEAVE_CS(&(uw_map->cs), rc);
         jk_log(l, JK_LOG_INFO,
                "Reloaded urimaps from %s", uw_map->fname);

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=613274&r1=613273&r2=613274&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 Fri Jan 18 13:14:24 2008
@@ -68,6 +68,23 @@
 #define SOURCE_TYPE_TEXT_DISCOVER   ("ajp14")
 
 #define JK_MAX_URI_LEN              4095
+
+struct rule_extension
+{
+    /* reply_timeout overwrite */
+    int reply_timeout;
+    /* activation state overwrites for load balancers */
+    /* Number of elements in the array activations. */
+    int size;
+    /* Dynamically allocated array with one entry per lb member. */
+    int *activation;
+    /* Temporary storage for the original extension strings. */
+    char *active;
+    char *disable;
+    char *stop;
+};
+typedef struct rule_extension rule_extension_t;
+
 struct uri_worker_record
 {
     /* Original uri for logging */
@@ -87,6 +104,9 @@
 
     /* char length of the context */
     size_t context_len;
+
+    /* extended mapping properties */
+    rule_extension_t extensions;
 };
 typedef struct uri_worker_record uri_worker_record_t;
 
@@ -146,6 +166,8 @@
 int uri_worker_map_open(jk_uri_worker_map_t *uw_map,
                         jk_map_t *init_data, jk_logger_t *l);
 
+void uri_worker_map_ext(jk_uri_worker_map_t *uw_map, jk_logger_t *l);
+
 int uri_worker_map_add(jk_uri_worker_map_t *uw_map,
                        const char *puri, const char *worker,
                        unsigned int source_type, jk_logger_t *l);
@@ -153,6 +175,11 @@
 const char *map_uri_to_worker(jk_uri_worker_map_t *uw_map,
                               const char *uri, const char *vhost,
                               jk_logger_t *l);
+
+const char *map_uri_to_worker_ext(jk_uri_worker_map_t *uw_map,
+                                  const char *uri, const char *vhost,
+                                  rule_extension_t **extensions,
+                                  jk_logger_t *l);
 
 int uri_worker_map_load(jk_uri_worker_map_t *uw_map,
                         jk_logger_t *l);

Modified: tomcat/connectors/trunk/jk/native/common/jk_util.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/common/jk_util.c?rev=613274&r1=613273&r2=613274&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/common/jk_util.c (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_util.c Fri Jan 18 13:14:24 2008
@@ -1867,7 +1867,8 @@
     s->reco_status = RECO_NONE;
     s->flush_packets = JK_FALSE;
     s->flush_header = JK_FALSE;
-    s->reply_timeout = -1;
+    s->extension.reply_timeout = -1;
+    s->extension.activation = NULL;
     s->response_started = JK_FALSE;
     s->http_response_status = JK_HTTP_OK;
     s->uw_map = NULL;

Modified: tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c?rev=613274&r1=613273&r2=613274&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Fri Jan 18 13:14:24 2008
@@ -1779,6 +1779,7 @@
                 if (wc_open(workers_map, &worker_env, logger)) {
                     rc = JK_TRUE;
                 }
+                uri_worker_map_ext(uw_map, logger);
             }
             else
                 jk_log(logger, JK_LOG_EMERG,



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


Mime
View raw message