billbarker    2003/08/25 21:20:04

  Modified:    jk/native/common jk_uri_worker_map.c
  Log:
  Changing the contract for map_uri_to_worker, as discussed on tomcat-dev.
  
  The 'uri' parameter is now considered to be modifiable by this routine.  This fixes 
a multi-threading problem when using Apache2 on high-end machines.
  
  Reported by: Marc Saegesser
  
  Revision  Changes    Path
  1.18      +3 -9      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- jk_uri_worker_map.c       6 Aug 2003 12:19:55 -0000       1.17
  +++ jk_uri_worker_map.c       26 Aug 2003 04:20:04 -0000      1.18
  @@ -490,14 +490,12 @@
           unsigned i;
           unsigned best_match = -1;
           unsigned longest_match = 0;
  -        char *clean_uri = jk_pool_strdup(&uw_map->tp,uri);
  -        char *url_rewrite = strstr(clean_uri, JK_PATH_SESSION_IDENTIFIER);
  +        char *url_rewrite = strstr(uri, JK_PATH_SESSION_IDENTIFIER);
           
           if(url_rewrite) {
               *url_rewrite = '\0';
           }
  -        jk_no2slash(clean_uri);
  -        uri = clean_uri;
  +        jk_no2slash(uri);
   
           jk_log(l, JK_LOG_DEBUG, "Attempting to map URI '%s'\n", uri);
           for(i = 0 ; i < uw_map->size ; i++) {
  @@ -518,7 +516,6 @@
                               "Found an exact match %s -> %s\n",
                               uwr->worker_name,
                               uwr->context );
  -                        jk_reset_pool(&uw_map->tp);
                           return uwr->worker_name;
                       }
                   } else if(MATCH_TYPE_CONTEXT == uwr->match_type) {
  @@ -594,7 +591,6 @@
           }
   
           if(-1 != best_match) {
  -            jk_reset_pool(&uw_map->tp);
               return uw_map->maps[best_match]->worker_name;
           } else {
               /*
  @@ -611,10 +607,8 @@
                   jk_log(l, JK_LOG_EMERG, 
                          "In jk_uri_worker_map_t::map_uri_to_worker, found a security 
fraud in '%s'\n",
                          uri);    
  -                jk_reset_pool(&uw_map->tp);
                   return uw_map->maps[fraud]->worker_name;
               }
  -            jk_reset_pool(&uw_map->tp);
          }        
       } else {
           jk_log(l, JK_LOG_ERROR, 
  
  
  

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

Reply via email to