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/native2/common jk_uriMap.c
Date Wed, 02 Oct 2002 10:58:06 GMT
mturk       2002/10/02 03:58:06

  Modified:    jk/native2/common jk_uriMap.c
  Log:
  Fix the wrong uri association with the webaps.
  If we specify the context in the uri, try the exactMap first cause webapp
  can have a name that is subset of some larger context, so that larger one
  would be used with the prefixMap only.
  
  Revision  Changes    Path
  1.48      +18 -7     jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c
  
  Index: jk_uriMap.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_uriMap.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- jk_uriMap.c	2 Oct 2002 10:28:36 -0000	1.47
  +++ jk_uriMap.c	2 Oct 2002 10:58:06 -0000	1.48
  @@ -487,7 +487,7 @@
           jk_uriEnv_t *hostEnv = jk2_uriMap_hostMap(env, uriMap, vhost, port);
           
           char *uri = uriEnv->uri;
  -        jk_uriEnv_t *ctxEnv;
  +        jk_uriEnv_t *ctxEnv = NULL;
   
           if (hostEnv == NULL)
               continue;
  @@ -498,19 +498,30 @@
   
           if (uri == NULL)
               continue;
  -        
  -        ctxEnv = jk2_uriMap_prefixMap(env, uriMap, hostEnv->webapps, uri,
  -                                      strlen(uri));
  +        
  +        /* If the context was specified try to find the exact one */
  +        if (uriEnv->contextPath != NULL)
  +            ctxEnv = jk2_uriMap_exactMap(env, uriMap, hostEnv->webapps,
  +                                         uriEnv->contextPath,
  +                                         uriEnv->ctxt_len);
  +        /* Next find by uri prefix */
  +        if (ctxEnv == NULL)
  +            ctxEnv = jk2_uriMap_prefixMap(env, uriMap, hostEnv->webapps, uri,
  +                                          strlen(uri));
   
           if (ctxEnv == NULL) {
               env->l->jkLog(env, env->l, JK_LOG_INFO, 
                              "uriMap.init() no context for %s\n", uri); 
               return JK_ERR;
  -        }
  +        }
  +
  +        /* Correct the context path if needed */
           uriEnv->contextPath = ctxEnv->prefix;
           uriEnv->ctxt_len = ctxEnv->prefix_len;
  -        env->l->jkLog(env, env->l, JK_LOG_INFO, 
  -                           "uriMap.init() adding context %s for %s\n", ctxEnv->prefix,
uri); 
  +
  +        if (uriMap->mbean->debug > 5) 
  +            env->l->jkLog(env, env->l, JK_LOG_INFO, 
  +                          "uriMap.init() adding context %s for %s\n", ctxEnv->prefix,
uri); 
   
           switch (uriEnv->match_type) {
               case MATCH_TYPE_EXACT:
  
  
  

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


Mime
View raw message