tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
Date Mon, 15 Oct 2001 00:06:46 GMT
keith       01/10/14 17:06:45

  Modified:    jk/native/iis jk_isapi_plugin.c
  Log:
  Add special marshalling for the Translate: header.
  IIS will not call the ISAPI extension if 'Translate: f'
  is specified by client.  Marshall it into a speacial
  header in the filter proc, then restore it to the
  original header in the extension proc.  Also, correct
  some wayward CRLF issues and a misspelling.
  
  Revision  Changes    Path
  1.8       +27 -4     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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- jk_isapi_plugin.c	2001/10/13 17:38:04	1.7
  +++ jk_isapi_plugin.c	2001/10/15 00:06:45	1.8
  @@ -82,15 +82,17 @@
   #define VERSION_STRING "Jakarta/ISAPI/1.0b1"
   
   /*
  - * We use special two headers to pass values from the filter to the 
  + * We use special headers to pass values from the filter to the 
    * extension. These values are:
    *
    * 1. The real URI before redirection took place
    * 2. The name of the worker to be used.
  + * 3. The contents of the Translate header, if any
    *
    */
   #define URI_HEADER_NAME         ("TOMCATURI:")
   #define WORKER_HEADER_NAME      ("TOMCATWORKER:")
  +#define TOMCAT_TRANSLATE_HEADER_NAME ("TOMCATTRANSLATE:")
   #define CONTENT_LENGTH          ("CONTENT_LENGTH:")
   
   #define HTTP_URI_HEADER_NAME     ("HTTP_TOMCATURI")
  @@ -574,10 +576,12 @@
           char uri[INTERNET_MAX_URL_LENGTH]; 
   		char snuri[INTERNET_MAX_URL_LENGTH]="/";
   		char Host[INTERNET_MAX_URL_LENGTH];
  +		char Translate[INTERNET_MAX_URL_LENGTH];
   
           char *query;
           DWORD sz = sizeof(uri);
           DWORD szHost = sizeof(Host);
  +        DWORD szTranslate = sizeof(Translate);
   
           jk_log(logger, JK_LOG_DEBUG, 
                  "HttpFilterProc started\n");
  @@ -587,7 +591,8 @@
            * Just in case somebody set these headers in the request!
            */
           p->SetHeader(pfc, URI_HEADER_NAME, NULL);
  -	    p->SetHeader(pfc, WORKER_HEADER_NAME, NULL);
  +        p->SetHeader(pfc, WORKER_HEADER_NAME, NULL);
  +        p->SetHeader(pfc, TOMCAT_TRANSLATE_HEADER_NAME, NULL);
           
           if (!p->GetHeader(pfc, "url", (LPVOID)uri, (LPDWORD)&sz)) {
               jk_log(logger, JK_LOG_ERROR, 
  @@ -654,6 +659,20 @@
                              "HttpFilterProc error while adding request headers\n");
                       return SF_STATUS_REQ_ERROR;
                   }
  +				
  +                /* Move Translate: header to a temporary header so
  +                 * that the extension proc will be called.
  +                 * This allows the servlet to handle 'Translate: f'.
  +                 */
  +                if(p->GetHeader(pfc, "Translate:", (LPVOID)Translate, (LPDWORD)&szTranslate)
&&
  +                    Translate != NULL && szTranslate > 0) {
  +                    if (!p->AddHeader(pfc, TOMCAT_TRANSLATE_HEADER_NAME, Translate))
{
  +                        jk_log(logger, JK_LOG_ERROR, 
  +                          "HttpFilterProc error while adding Tomcat-Translate headers\n");
  +                        return SF_STATUS_REQ_ERROR;
  +                    }
  +                p->SetHeader(pfc, "Translate:", NULL);
  +                }
               } else {
                   jk_log(logger, JK_LOG_DEBUG, 
                          "HttpFilterProc [%s] is not a servlet url\n", 
  @@ -1199,6 +1218,10 @@
                      !strnicmp(tmp, CONTENT_LENGTH, strlen(CONTENT_LENGTH))) {
                       need_content_length_header = FALSE;
                       s->headers_names[i]  = tmp;
  +                } else if (!strnicmp(tmp, TOMCAT_TRANSLATE_HEADER_NAME,
  +                                          strlen(TOMCAT_TRANSLATE_HEADER_NAME))) {
  +                    tmp += 6; /* TOMCAT */
  +                    s->headers_names[i]  = tmp;
                   } else {
                       s->headers_names[i]  = tmp;
                   }
  @@ -1214,7 +1237,7 @@
                   *tmp = '\0';
                   tmp++;
   
  -                /* Skipp all the WS chars after the ':' to the beginning of th header value
*/
  +                /* Skip all the WS chars after the ':' to the beginning of th header value
*/
                   while(' ' == *tmp || '\t' == *tmp || '\v' == *tmp) {
                       tmp++;
                   }
  
  
  

Mime
View raw message