larryi      01/12/08 07:42:25

  Modified:    jk/native/iis jk_isapi_plugin.c
  Log:
  Fix bug where if uri is shortened by un-escaping or normalizing, the query
  string gets lost.
  
  Also converted some tabs to spaces.
  
  Revision  Changes    Path
  1.10      +40 -32    jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- jk_isapi_plugin.c 2001/11/07 21:46:28     1.9
  +++ jk_isapi_plugin.c 2001/12/08 15:42:25     1.10
  @@ -60,7 +60,7 @@
    * Author:      Gal Shachor <[EMAIL PROTECTED]>                           *
    * Author:      Larry Isaacs <[EMAIL PROTECTED]>                           *
    * Author:      Ignacio J. Ortega <[EMAIL PROTECTED]>                       *
  - * Version:     $Revision: 1.9 $                                           *
  + * Version:     $Revision: 1.10 $                                           *
    ***************************************************************************/
   
   // This define is needed to include wincrypt,h, needed to get client certificates
  @@ -554,21 +554,21 @@
                               DWORD dwNotificationType, 
                               LPVOID pvNotification)
   {
  -     /* Initialise jk */
  -     if (is_inited && !is_mapread) {
  -             char serverName[MAX_SERVERNAME];
  -             DWORD dwLen = sizeof(serverName);
  -
  -             if (pfc->GetServerVariable(pfc, SERVER_NAME, serverName, &dwLen))
  -             {
  -                     if (dwLen > 0) serverName[dwLen-1] = '\0';
  -                     if (init_jk(serverName))
  -                             is_mapread = JK_TRUE;
  -             }
  -             /* If we can't read the map we become dormant */
  -             if (!is_mapread)
  -                     is_inited = JK_FALSE;
  -     }
  +    /* Initialise jk */
  +    if (is_inited && !is_mapread) {
  +        char serverName[MAX_SERVERNAME];
  +        DWORD dwLen = sizeof(serverName);
  +
  +        if (pfc->GetServerVariable(pfc, SERVER_NAME, serverName, &dwLen))
  +        {
  +            if (dwLen > 0) serverName[dwLen-1] = '\0';
  +            if (init_jk(serverName))
  +                is_mapread = JK_TRUE;
  +        }
  +        /* If we can't read the map we become dormant */
  +        if (!is_mapread)
  +            is_inited = JK_FALSE;
  +    }
   
       if (is_inited &&
          (SF_NOTIFY_PREPROC_HEADERS == dwNotificationType)) { 
  @@ -627,22 +627,30 @@
               }
               getparents(uri);
   
  -                     if(p->GetHeader(pfc, "Host:", (LPVOID)Host, (LPDWORD)&szHost)) 
{
  -                             strcat(snuri,Host);
  -                             strcat(snuri,uri);
  -                             jk_log(logger, JK_LOG_DEBUG, 
  -                                        "In HttpFilterProc Virtual Host redirection 
of %s\n", 
  -                                        snuri);
  -                             worker = map_uri_to_worker(uw_map, snuri, logger);     
           
  -                     }
  -                     if (!worker) {
  -                             jk_log(logger, JK_LOG_DEBUG, 
  -                                        "In HttpFilterProc test Default redirection 
of %s\n", 
  -                                        uri);
  -                             worker = map_uri_to_worker(uw_map, uri, logger);
  -                     }
  -            if (query) {
  -                *query = '?';
  +            if(p->GetHeader(pfc, "Host:", (LPVOID)Host, (LPDWORD)&szHost)) {
  +                strcat(snuri,Host);
  +                strcat(snuri,uri);
  +                jk_log(logger, JK_LOG_DEBUG, 
  +                       "In HttpFilterProc Virtual Host redirection of %s\n", 
  +                       snuri);
  +                worker = map_uri_to_worker(uw_map, snuri, logger);                
  +            }
  +            if (!worker) {
  +                jk_log(logger, JK_LOG_DEBUG, 
  +                       "In HttpFilterProc test Default redirection of %s\n", 
  +                       uri);
  +                worker = map_uri_to_worker(uw_map, uri, logger);
  +            }
  +            if(query) {
  +                char *querytmp = uri + strlen(uri);
  +                *querytmp++ = '?';
  +                query++;
  +                /* if uri was shortened, move the query characters */
  +                if (querytmp != query) {
  +                    while (*query != '\0')
  +                        *querytmp++ = *query++;
  +                    *querytmp = '\0';
  +                }
               }
   
               if (worker) {
  
  
  

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

Reply via email to