tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hgo...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_uri_worker_map.c
Date Fri, 28 Sep 2001 09:18:18 GMT
hgomez      01/09/28 02:18:18

  Modified:    jk/native/common jk_uri_worker_map.c
  Log:
  Back port from TC 3.3
  
  Revision  Changes    Path
  1.9       +20 -6     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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- jk_uri_worker_map.c	2001/09/27 10:42:26	1.8
  +++ jk_uri_worker_map.c	2001/09/28 09:18:17	1.9
  @@ -67,7 +67,7 @@
    * servlet container.                                                      *
    *                                                                         *
    * Author:      Gal Shachor <shachor@il.ibm.com>                           *
  - * Version:     $Revision: 1.8 $                                           *
  + * Version:     $Revision: 1.9 $                                           *
    ***************************************************************************/
   
   #include "jk_pool.h"
  @@ -103,6 +103,10 @@
       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;
   
  @@ -350,7 +354,13 @@
           int sz;
   
           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->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;
           
  @@ -378,6 +388,7 @@
           if (rc == JK_FALSE) {
               jk_log(l, JK_LOG_ERROR, "jk_uri_worker_map_t::uri_worker_map_open, there was
an error, freing buf\n");
               jk_close_pool(&uw_map->p);
  +            jk_close_pool(&uw_map->tp);
           }
       }
       
  @@ -393,6 +404,7 @@
   
       if(uw_map) {
           jk_close_pool(&uw_map->p);
  +        jk_close_pool(&uw_map->tp);
   	return JK_TRUE;
       }
   
  @@ -413,11 +425,11 @@
           unsigned i;
           unsigned best_match = -1;
           unsigned longest_match = 0;
  -        char clean_uri = NULL;
  +        char * clean_uri = NULL;
           char *url_rewrite = strstr(uri, JK_PATH_SESSION_IDENTIFIER);
           
           if(url_rewrite) {
  -            clean_uri = strdup(uri);
  +            clean_uri = jk_pool_strdup(&uw_map->tp,uri);
               url_rewrite = strstr(clean_uri, JK_PATH_SESSION_IDENTIFIER);
               *url_rewrite = '\0';
               uri = clean_uri;
  @@ -441,6 +453,7 @@
   			       "jk_uri_worker_map_t::map_uri_to_worker, 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) {
  @@ -485,7 +498,7 @@
           }
   
           if(-1 != best_match) {
  -            free(clean_uri);
  +            jk_reset_pool(&uw_map->tp);
               return uw_map->maps[best_match]->worker_name;
           } else {
               /*
  @@ -502,9 +515,10 @@
                   jk_log(l, JK_LOG_EMERG, 
                          "In jk_uri_worker_map_t::map_uri_to_worker, found a security fraud
in '%s'\n",
                          uri);    
  -                free(clean_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, 
  
  
  

Mime
View raw message