tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_shm.c jk_shm.h jk_uri_worker_map.c jk_uri_worker_map.h
Date Sun, 20 Feb 2005 12:21:10 GMT
mturk       2005/02/20 04:21:10

  Modified:    jk/native/common jk_shm.c jk_shm.h jk_uri_worker_map.c
                        jk_uri_worker_map.h
  Log:
  Use shared memory for uri mappings. It stores only the match type
  inside shared memory to be able to disable particular map at runtime.
  Adding new maps will be done rereading uriworkermaps file.
  
  Revision  Changes    Path
  1.15      +19 -2     jakarta-tomcat-connectors/jk/native/common/jk_shm.c
  
  Index: jk_shm.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_shm.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_shm.c	17 Feb 2005 15:03:15 -0000	1.14
  +++ jk_shm.c	20 Feb 2005 12:21:10 -0000	1.15
  @@ -20,7 +20,9 @@
    * Version:     $Revision$                                           *
    ***************************************************************************/
   
  +#include "jk_global.h"
   #include "jk_pool.h"
  +#include "jk_util.h"
   #include "jk_mt.h"
   #include "jk_shm.h"
   
  @@ -33,7 +35,6 @@
       size_t pos;
       unsigned int childs;
       unsigned int workers;
  -
       unsigned int urimaps;
       time_t modified;
       char   buf[1];
  @@ -58,6 +59,7 @@
   static const char shm_signature[] = { JK_SHM_MAGIC };
   static jk_shm_t jk_shmem = { 0, NULL, -1, -1, 0, NULL};
   static time_t jk_workers_modified_time = 0;
  +static time_t jk_workers_access_time = 0;
   
   #if defined (WIN32) || defined(NETWARE)
   
  @@ -366,6 +368,21 @@
           jk_shmem.hdr->modified = t;
       else
           jk_workers_modified_time = t;
  +    jk_workers_access_time = t;
  +}
  +
  +int jk_shm_is_modified()
  +{
  +    time_t m = jk_shm_get_workers_time();
  +    if (m != jk_workers_access_time)
  +        return 1;
  +    else
  +        return 0;
  +}
  +
  +void jk_shm_sync_access_time()
  +{
  +    jk_workers_access_time = jk_shm_get_workers_time();
   }
   
   int jk_shm_lock()
  
  
  
  1.14      +15 -5     jakarta-tomcat-connectors/jk/native/common/jk_shm.h
  
  Index: jk_shm.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_shm.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- jk_shm.h	19 Feb 2005 08:12:29 -0000	1.13
  +++ jk_shm.h	20 Feb 2005 12:21:10 -0000	1.14
  @@ -92,11 +92,8 @@
   struct jk_shm_urimap
   {
       int          id;
  +    int          worker_id;
       unsigned int match_type;
  -    size_t       ctxt_len;
  -    char         context[JK_SHM_URI_SIZ+1];
  -    char         worker[JK_SHM_STR_SIZ+1];
  -    char         suffix[JK_SHM_STR_SIZ+1];
   };
   typedef struct jk_shm_urimap jk_shm_urimap_t;
   
  @@ -138,6 +135,19 @@
    */
   void jk_shm_set_workers_time(time_t t);
   
  +/* Check if the shared memory has been modified
  + * by some other process.
  + */
  +int jk_shm_is_modified();
  +
  +/* Synchronize access and modification time.
  + * This function should be called when the shared memory
  + * is modified and after we update the config acording
  + * to the current shared memory data.
  + */
  +void jk_shm_sync_access_time();
  +
  +
   /* Lock shared memory for thread safe access */
   int jk_shm_lock();
   
  
  
  
  1.46      +72 -120   jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c
  
  Index: jk_uri_worker_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- jk_uri_worker_map.c	12 Feb 2005 19:29:08 -0000	1.45
  +++ jk_uri_worker_map.c	20 Feb 2005 12:21:10 -0000	1.46
  @@ -26,15 +26,6 @@
   #include "jk_util.h"
   #include "jk_uri_worker_map.h"
   
  -#define MATCH_TYPE_EXACT    (0)
  -#define MATCH_TYPE_CONTEXT  (1)
  -#define MATCH_TYPE_SUFFIX   (2)
  -#define MATCH_TYPE_GENERAL_SUFFIX (3)   /* match all URIs of the form *ext */
  -/* match all context path URIs with a path component suffix */
  -#define MATCH_TYPE_CONTEXT_PATH (4)
  -/* match multiple wild characters (*) and (?) */
  -#define MATCH_TYPE_WILDCHAR_PATH (5)
  -
   #ifdef WIN32
   #define JK_STRCMP   strcasecmp
   #define JK_STRNCMP  strnicmp
  @@ -43,59 +34,11 @@
   #define JK_STRNCMP  strncmp
   #endif
   
  -struct uri_worker_record
  -{
  -    /* Original uri for logging */
  -    char *uri;
  -
  -    /* Name of worker mapped */
  -    const char *worker_name;
  -
  -    /* Suffix of uri */
  -    char *suffix;
  -
  -    /* Base context */
  -    char *context;
  -
  -    /* char length of the context */
  -    unsigned ctxt_len;
  -
  -    int match_type;
  -
  -    /* no map directive */
  -    int no_match;
  -};
  -
  -typedef struct uri_worker_record uri_worker_record_t;
  -
  -struct jk_uri_worker_map
  -{
  -    /* Memory Pool */
  -    jk_pool_t p;
  -    jk_pool_atom_t buf[SMALL_POOL_SIZE];
  -
  -    /* Temp Pool */
  -    jk_pool_t tp;
  -    jk_pool_atom_t tbuf[SMALL_POOL_SIZE];
  -
  -    /* map URI->WORKER */
  -    uri_worker_record_t **maps;
  -
  -    /* Map Number */
  -    unsigned int size;
  -
  -    /* Map Capacity */
  -    unsigned int capacity;
  -
  -    /* NoMap Number */
  -    unsigned int no_size;
  -};
  -
   static int worker_compare(const void *elem1, const void *elem2)
   {
       uri_worker_record_t *e1 = *(uri_worker_record_t **)elem1;
       uri_worker_record_t *e2 = *(uri_worker_record_t **)elem2;
  -    return ((int)e2->ctxt_len - (int)e1->ctxt_len);
  +    return ((int)e2->context_len - (int)e1->context_len);
   }
   
   static void worker_qsort(jk_uri_worker_map_t *uw_map)
  @@ -152,7 +95,7 @@
       unsigned i;
   
       for (i = 0; i < uw_map->size; i++) {
  -        if (MATCH_TYPE_SUFFIX == uw_map->maps[i]->match_type) {
  +        if (MATCH_TYPE_SUFFIX == uw_map->maps[i]->s->match_type) {
               char *suffix_start;
               for (suffix_start = strstr(uri, uw_map->maps[i]->suffix);
                    suffix_start;
  @@ -170,7 +113,7 @@
                            || (' ' == *after_suffix))
                           && (0 ==
                               JK_STRNCMP(uw_map->maps[i]->context, uri,
  -                                       uw_map->maps[i]->ctxt_len))) {
  +                                       uw_map->maps[i]->context_len))) {
                           /* 
                            * Security violation !!!
                            * this is a fraud.
  @@ -212,7 +155,6 @@
   
       if (uw_map) {
           jk_close_pool(&uw_map->p);
  -        jk_close_pool(&uw_map->tp);
           JK_TRACE_EXIT(l);
           return JK_TRUE;
       }
  @@ -273,11 +215,11 @@
   
   
   int uri_worker_map_add(jk_uri_worker_map_t *uw_map,
  -                       const char *puri, const char *pworker, jk_logger_t *l)
  +                       const char *puri, const char *worker, jk_logger_t *l)
   {
       uri_worker_record_t *uwr;
       char *uri;
  -    char *worker;
  +    unsigned int match_type = 0;
   
       JK_TRACE_ENTER(l);
       if (uri_worker_map_realloc(uw_map) == JK_FALSE) {
  @@ -297,15 +239,11 @@
       uwr->suffix = NULL;
       
       if (*puri == '!') {
  -        uwr->no_match = 1;
  +        match_type = MATCH_TYPE_NO_MATCH;
           puri++;
       }
  -    else
  -        uwr->no_match = 0;
   
       uri = jk_pool_strdup(&uw_map->p, puri);
  -    worker = jk_pool_strdup(&uw_map->p, pworker);
  -
       if (!uri || !worker) {
           jk_log(l, JK_LOG_ERROR,
                  "can't alloc uri/worker strings");
  @@ -324,7 +262,7 @@
                * /context/ * /user/ *
                */
               uwr->context = uri;
  -            uwr->match_type = MATCH_TYPE_WILDCHAR_PATH;
  +            match_type |= MATCH_TYPE_WILDCHAR_PATH;
               jk_log(l, JK_LOG_DEBUG,
                       "wild chars path rule %s=%s was added",
                       uri, worker);
  @@ -352,7 +290,7 @@
                       asterisk[1] = '\0';
                       uwr->context = uri;
                       uwr->suffix = asterisk + 2;
  -                    uwr->match_type = MATCH_TYPE_CONTEXT_PATH;
  +                    match_type |= MATCH_TYPE_CONTEXT_PATH;
                       jk_log(l, JK_LOG_DEBUG,
                              "general context path rule %s*%s=%s was added",
                              uri, asterisk + 2, worker);
  @@ -362,7 +300,7 @@
                       asterisk[1] = asterisk[2] = '\0';
                       uwr->context = uri;
                       uwr->suffix = asterisk + 3;
  -                    uwr->match_type = MATCH_TYPE_SUFFIX;
  +                    match_type |= MATCH_TYPE_SUFFIX;
                       jk_log(l, JK_LOG_DEBUG,
                              "suffix rule %s.%s=%s was added",
                              uri, asterisk + 3, worker);
  @@ -372,7 +310,7 @@
                       asterisk[1] = '\0';
                       uwr->context = uri;
                       uwr->suffix = asterisk + 2;
  -                    uwr->match_type = MATCH_TYPE_GENERAL_SUFFIX;
  +                    match_type |= MATCH_TYPE_GENERAL_SUFFIX;
                       jk_log(l, JK_LOG_DEBUG,
                              "general suffix rule %s*%s=%s was added",
                              uri, asterisk + 2, worker);
  @@ -381,7 +319,7 @@
                       /* context based */
                       asterisk[1] = '\0';
                       uwr->context = uri;
  -                    uwr->match_type = MATCH_TYPE_CONTEXT;
  +                    match_type |= MATCH_TYPE_CONTEXT;
                       jk_log(l, JK_LOG_DEBUG,
                              "match rule %s=%s was added", uri, worker);
                   }
  @@ -390,7 +328,7 @@
                   /* Something like : JkMount /servlets/exampl* ajp13 */
                   uwr->uri = uri;
                   uwr->context = uri;
  -                uwr->match_type = MATCH_TYPE_EXACT;
  +                match_type |= MATCH_TYPE_EXACT;
                   jk_log(l, JK_LOG_DEBUG,
                          "exact rule %s=%s was added",
                          uri, worker);
  @@ -401,13 +339,13 @@
               /* Something like:  JkMount /login/j_security_check ajp13 */
               uwr->uri = uri;
               uwr->context = uri;
  -            uwr->match_type = MATCH_TYPE_EXACT;
  +            match_type |= MATCH_TYPE_EXACT;
               jk_log(l, JK_LOG_DEBUG,
                      "exact rule %s=%s was added",
                      uri, worker);
           }
           uwr->worker_name = worker;
  -        uwr->ctxt_len = strlen(uwr->context);
  +        uwr->context_len = strlen(uwr->context);
       }
       else {
           /*
  @@ -425,11 +363,19 @@
   
       uw_map->maps[uw_map->size] = uwr;
       uw_map->size++;
  -    if (uwr->no_match) {    
  +    if (match_type & MATCH_TYPE_NO_MATCH) {    
           /* If we split the mappings this one will be calculated */
  -        uw_map->no_size++;
  +        uw_map->nosize++;
       }
       worker_qsort(uw_map);
  +    uwr->s = jk_shm_alloc_urimap(&uw_map->p);
  +    if (!uwr->s) {
  +        jk_log(l, JK_LOG_ERROR,
  +               "can't alloc shared memory map entry");
  +        JK_TRACE_EXIT(l);
  +        return JK_FALSE;
  +    }
  +    uwr->s->match_type = match_type;
       JK_TRACE_EXIT(l);
       return JK_TRUE;
   }
  @@ -450,9 +396,6 @@
           rc = JK_TRUE;
           jk_open_pool(&uw_map->p,
                        uw_map->buf, sizeof(jk_pool_atom_t) * SMALL_POOL_SIZE);
  -        jk_open_pool(&uw_map->tp,
  -                     uw_map->tbuf, sizeof(jk_pool_atom_t) * SMALL_POOL_SIZE);
  -
           uw_map->size = 0;
           uw_map->maps = NULL;
   
  @@ -490,7 +433,6 @@
               jk_log(l, JK_LOG_ERROR,
                      "there was an error, freing buf");
               jk_close_pool(&uw_map->p);
  -            jk_close_pool(&uw_map->tp);
           }
       }
   
  @@ -539,7 +481,8 @@
   #endif
   
   static int is_nomap_match(jk_uri_worker_map_t *uw_map,
  -                          const char *uri, jk_logger_t *l)
  +                          const char *uri, const char* worker,
  +                          jk_logger_t *l)
   {
       unsigned int i;
   
  @@ -549,11 +492,14 @@
           uri_worker_record_t *uwr = uw_map->maps[i];
   
           /* Check only nomatch mappings */
  -        if (!uwr->no_match)
  +        if (!(uwr->s->match_type & MATCH_TYPE_NO_MATCH) ||
  +            (uwr->s->match_type & MATCH_TYPE_DISABLED))
  +            continue;        
  +        /* Check only mathing workers */
  +        if (strcmp(uwr->worker_name, worker))
               continue;
  -
  -        if (uwr->match_type == MATCH_TYPE_WILDCHAR_PATH) {
  -            /* Map is already sorted by ctxt_len */
  +        if (uwr->s->match_type & MATCH_TYPE_WILDCHAR_PATH) {
  +            /* Map is already sorted by context_len */
               if (wildchar_match(uri, uwr->context,
   #ifdef WIN32
                                  1
  @@ -568,9 +514,9 @@
                       return JK_TRUE;
                }
           }
  -        else if (JK_STRNCMP(uwr->context, uri, uwr->ctxt_len) == 0) {
  -            if (uwr->match_type == MATCH_TYPE_EXACT) {
  -                if (strlen(uri) == uwr->ctxt_len) {
  +        else if (JK_STRNCMP(uwr->context, uri, uwr->context_len) == 0) {
  +            if (uwr->s->match_type & MATCH_TYPE_EXACT) {
  +                if (strlen(uri) == uwr->context_len) {
                       if (JK_IS_DEBUG_LEVEL(l))
                           jk_log(l, JK_LOG_DEBUG,
                                  "Found an exact no match %s -> %s",
  @@ -579,7 +525,7 @@
                       return JK_TRUE;
                   }
               }
  -            else if (uwr->match_type == MATCH_TYPE_CONTEXT) {
  +            else if (uwr->s->match_type & MATCH_TYPE_CONTEXT) {
                   if (JK_IS_DEBUG_LEVEL(l))
                       jk_log(l, JK_LOG_DEBUG,
                              "Found a context no match %s -> %s",
  @@ -587,7 +533,7 @@
                   JK_TRACE_EXIT(l);
                   return JK_TRUE;
               }
  -            else if (uwr->match_type == MATCH_TYPE_GENERAL_SUFFIX) {
  +            else if (uwr->s->match_type & MATCH_TYPE_GENERAL_SUFFIX) {
                   int suffix_start = last_index_of(uri, uwr->suffix[0]);
                   if (suffix_start >= 0
                       && 0 == JK_STRCMP(uri + suffix_start, uwr->suffix)) {
  @@ -599,7 +545,7 @@
                           return JK_TRUE;
                   }
               }
  -            else if (uwr->match_type == MATCH_TYPE_CONTEXT_PATH) {
  +            else if (uwr->s->match_type & MATCH_TYPE_CONTEXT_PATH) {
                   char *suffix_path = NULL;
                   if (strlen(uri) > 1
                       && (suffix_path = strchr(uri + 1, '/')) != NULL) {
  @@ -624,7 +570,7 @@
                   if (uri[suffix_start] == '.') {
                       const char *suffix = uri + suffix_start + 1;
                       if (JK_STRCMP(suffix, uwr->suffix) == 0) {
  -                        if (uwr->no_match) {
  +                        if (uwr->s->match_type & MATCH_TYPE_NO_MATCH) {
                               if (JK_IS_DEBUG_LEVEL(l))
                                   jk_log(l, JK_LOG_DEBUG,
                                          "Found a no suffix match for %s -> %s",
  @@ -648,7 +594,7 @@
   {
       unsigned int i;
       int best_match = -1;
  -    unsigned int longest_match = 0;
  +    size_t longest_match = 0;
       char *url_rewrite;
       char rewrite_char = ';';
       const char *rv = NULL;
  @@ -685,26 +631,22 @@
           jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s' from %d maps",
                  uri, uw_map->size);
   
  -    /* Check nomatch first */
  -    if (uw_map->no_size && is_nomap_match(uw_map, uri, l)) {
  -        /* Found a no match */        
  -        JK_TRACE_EXIT(l);
  -        goto cleanup;;
  -    }
       for (i = 0; i < uw_map->size; i++) {
           uri_worker_record_t *uwr = uw_map->maps[i];
   
  -        /* Check for no match in any case */
  -        if (uwr->no_match || (uwr->ctxt_len < longest_match)) {
  +        /* Check for match types */
  +        if ((uwr->s->match_type & MATCH_TYPE_DISABLED) ||
  +            (uwr->s->match_type & MATCH_TYPE_NO_MATCH) ||
  +            (uwr->context_len < longest_match)) {
               /* can not be a best match anyway */
               continue;
           }
           if (JK_IS_DEBUG_LEVEL(l))
               jk_log(l, JK_LOG_DEBUG, "Attempting to map context URI '%s'", uwr->uri);
   
  -        if (uwr->match_type == MATCH_TYPE_WILDCHAR_PATH) {
  +        if (uwr->s->match_type & MATCH_TYPE_WILDCHAR_PATH) {
               const char *wname;
  -            /* Map is already sorted by ctxt_len */
  +            /* Map is already sorted by context_len */
               if (wildchar_match(uri, uwr->context,
   #ifdef WIN32
                                  1
  @@ -722,9 +664,9 @@
                       goto cleanup;
                }
           }
  -        else if (JK_STRNCMP(uwr->context, uri, uwr->ctxt_len) == 0) {
  -            if (uwr->match_type == MATCH_TYPE_EXACT) {
  -                if (strlen(uri) == uwr->ctxt_len) {
  +        else if (JK_STRNCMP(uwr->context, uri, uwr->context_len) == 0) {
  +            if (uwr->s->match_type & MATCH_TYPE_EXACT) {
  +                if (strlen(uri) == uwr->context_len) {
                       if (JK_IS_DEBUG_LEVEL(l))
                           jk_log(l, JK_LOG_DEBUG,
                                  "Found an exact match %s -> %s",
  @@ -734,43 +676,43 @@
                       goto cleanup;
                   }
               }
  -            else if (uwr->match_type == MATCH_TYPE_CONTEXT) {
  -                if (uwr->ctxt_len > longest_match) {
  +            else if (uwr->s->match_type & MATCH_TYPE_CONTEXT) {
  +                if (uwr->context_len > longest_match) {
                       if (JK_IS_DEBUG_LEVEL(l))
                           jk_log(l, JK_LOG_DEBUG,
                                  "Found a context match %s -> %s",
                                  uwr->worker_name, uwr->context);
  -                    longest_match = uwr->ctxt_len;
  +                    longest_match = uwr->context_len;
                       best_match = i;
                   }
               }
  -            else if (uwr->match_type == MATCH_TYPE_GENERAL_SUFFIX) {
  +            else if (uwr->s->match_type & MATCH_TYPE_GENERAL_SUFFIX) {
                   int suffix_start = last_index_of(uri, uwr->suffix[0]);
                   if (suffix_start >= 0
                       && 0 == strcmp(uri + suffix_start, uwr->suffix)) {
  -                    if (uwr->ctxt_len >= longest_match) {
  +                    if (uwr->context_len >= longest_match) {
                           if (JK_IS_DEBUG_LEVEL(l))
                               jk_log(l, JK_LOG_DEBUG,
                                      "Found a general suffix match %s -> *%s",
                                      uwr->worker_name, uwr->suffix);
  -                        longest_match = uwr->ctxt_len;
  +                        longest_match = uwr->context_len;
                           best_match = i;
                       }
                   }
               }
  -            else if (uwr->match_type == MATCH_TYPE_CONTEXT_PATH) {
  +            else if (uwr->s->match_type & MATCH_TYPE_CONTEXT_PATH) {
                   char *suffix_path = NULL;
                   if (strlen(uri) > 1
                       && (suffix_path = strchr(uri + 1, '/')) != NULL) {
                       if (0 ==
                           JK_STRNCMP(suffix_path, uwr->suffix,
                                      strlen(uwr->suffix))) {
  -                        if (uwr->ctxt_len >= longest_match) {
  +                        if (uwr->context_len >= longest_match) {
                               if (JK_IS_DEBUG_LEVEL(l))
                                   jk_log(l, JK_LOG_DEBUG,
                                          "Found a general context path match %s -> *%s",
                                          uwr->worker_name, uwr->suffix);
  -                            longest_match = uwr->ctxt_len;
  +                            longest_match = uwr->context_len;
                               best_match = i;
                           }
                       }
  @@ -788,12 +730,12 @@
                       const char *suffix = uri + suffix_start + 1;
                       /* for WinXX, fix the JsP != jsp problems */
                       if (JK_STRCMP(suffix, uwr->suffix) == 0) {
  -                        if (uwr->ctxt_len >= longest_match) {
  +                        if (uwr->context_len >= longest_match) {
                               if (JK_IS_DEBUG_LEVEL(l))
                                   jk_log(l, JK_LOG_DEBUG,
                                          "Found a suffix match %s -> *.%s",
                                          uwr->worker_name, uwr->suffix);
  -                            longest_match = uwr->ctxt_len;
  +                            longest_match = uwr->context_len;
                               best_match = i;
                           }
                       }
  @@ -832,5 +774,15 @@
   cleanup:
       if (url_rewrite)
           *url_rewrite = rewrite_char;
  +    if (rv && uw_map->nosize) {
  +        if (is_nomap_match(uw_map, uri, rv, l)) {
  +            if (JK_IS_DEBUG_LEVEL(l))
  +                jk_log(l, JK_LOG_DEBUG,
  +                        "Denying matching for worker %s by nomatch rule",
  +                        rv);
  +            JK_TRACE_EXIT(l);
  +            rv = NULL;
  +        }
  +    }
       return rv;
   }
  
  
  
  1.15      +55 -2     jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.h
  
  Index: jk_uri_worker_map.h
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_uri_worker_map.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- jk_uri_worker_map.h	12 Feb 2005 11:55:33 -0000	1.14
  +++ jk_uri_worker_map.h	20 Feb 2005 12:21:10 -0000	1.15
  @@ -32,8 +32,61 @@
   #include "jk_global.h"
   #include "jk_map.h"
   #include "jk_logger.h"
  +#include "jk_shm.h"
   
  -struct jk_uri_worker_map;
  +#define MATCH_TYPE_EXACT            0x0001
  +#define MATCH_TYPE_CONTEXT          0x0002
  +/* match all context path URIs with a path component suffix */
  +#define MATCH_TYPE_CONTEXT_PATH     0x0004
  +#define MATCH_TYPE_SUFFIX           0x0010
  +/* match all URIs of the form *ext */
  +#define MATCH_TYPE_GENERAL_SUFFIX   0x0020
  +/* match multiple wild characters (*) and (?) */
  +#define MATCH_TYPE_WILDCHAR_PATH    0x0040
  +#define MATCH_TYPE_NO_MATCH         0x1000
  +#define MATCH_TYPE_DISABLED         0x2000
  +
  +struct uri_worker_record
  +{
  +    /* Original uri for logging */
  +    char *uri;
  +
  +    /* Name of worker mapped */
  +    const char *worker_name;
  +
  +    /* Shared memory uri->worker mappings */
  +    jk_shm_urimap_t *s;
  +
  +    /* Suffix of uri */
  +    const char *suffix;
  +
  +    /* Base context */
  +    const char *context;
  +
  +    /* char length of the context */
  +    size_t context_len;
  +};
  +typedef struct uri_worker_record uri_worker_record_t;
  +
  +struct jk_uri_worker_map
  +{
  +    /* Memory Pool */
  +    jk_pool_t p;
  +    jk_pool_atom_t buf[BIG_POOL_SIZE];
  +
  +    /* map URI->WORKER */
  +    uri_worker_record_t **maps;
  +    
  +    /* Map Number */
  +    unsigned int size;
  +
  +    /* Map Capacity */
  +    unsigned int capacity;
  +
  +    /* NoMap Number */
  +    unsigned int nosize;
  +
  +};
   typedef struct jk_uri_worker_map jk_uri_worker_map_t;
   
   int uri_worker_map_alloc(jk_uri_worker_map_t **uw_map,
  
  
  

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


Mime
View raw message