tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rj...@apache.org
Subject svn commit: r701383 - /tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
Date Fri, 03 Oct 2008 14:01:34 GMT
Author: rjung
Date: Fri Oct  3 07:01:34 2008
New Revision: 701383

URL: http://svn.apache.org/viewvc?rev=701383&view=rev
Log:
Add define USE_RAW_HEADERS:
Possible Fix for BZ 38895: We are mixing up "_" and "-"
because we are using the CGI style IIS headers instead of
the original raw ones.
Needs a bit more testing, but looked good in January.
And: Finally a fix that shortens the code ...

Modified:
    tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c

Modified: tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c?rev=701383&r1=701382&r2=701383&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/connectors/trunk/jk/native/iis/jk_isapi_plugin.c Fri Oct  3 07:01:34 2008
@@ -81,11 +81,17 @@
 #define WORKER_HEADER_NAME_BASE           ("TOMCATWORKER")
 #define WORKER_HEADER_INDEX_BASE          ("TOMCATWORKERIDX")
 #define TOMCAT_TRANSLATE_HEADER_NAME_BASE ("TOMCATTRANSLATE")
+#ifdef USE_RAW_HEADERS
+#define CONTENT_LENGTH                    ("CONTENT-LENGTH:")
+#else
 #define CONTENT_LENGTH                    ("CONTENT_LENGTH:")
+#endif
 
 /* The HTTP_ form of the header for use in ExtensionProc */
 #define HTTP_HEADER_PREFIX       "HTTP_"
+#ifndef USE_RAW_HEADERS
 #define HTTP_HEADER_PREFIX_LEN   5
+#endif
 
 /* The template used to construct our unique headers
  * from the base name and module instance
@@ -413,7 +419,9 @@
 
 
 #define STRNULL_FOR_NULL(x) ((x) ? (x) : "(null)")
+#ifndef USE_RAW_HEADERS
 #define JK_TOLOWER(x)   ((char)tolower((BYTE)(x)))
+#endif
 
 #define GET_SERVER_VARIABLE_VALUE(name, place)          \
   do {                                                  \
@@ -2835,7 +2843,11 @@
 
     huge_buf_sz = MAX_PACKET_SIZE;
     if (get_server_value(private_data->lpEcb,
+#ifdef USE_RAW_HEADERS
+                         "ALL_RAW", huge_buf, huge_buf_sz)) {
+#else
                          "ALL_HTTP", huge_buf, huge_buf_sz)) {
+#endif
         unsigned int cnt = 0;
         char *tmp;
 
@@ -2868,8 +2880,10 @@
             for (i = 0, tmp = headers_buf; *tmp && i < cnt;) {
                 int real_header = JK_TRUE;
 
+#ifndef USE_RAW_HEADERS
                 /* Skip the HTTP_ prefix to the beginning of the header name */
                 tmp += HTTP_HEADER_PREFIX_LEN;
+#endif
 
                 if (!strnicmp(tmp, URI_HEADER_NAME, strlen(URI_HEADER_NAME))
                     || !strnicmp(tmp, WORKER_HEADER_NAME,
@@ -2900,12 +2914,14 @@
                 }
 
                 while (':' != *tmp && *tmp) {
+#ifndef USE_RAW_HEADERS
                     if ('_' == *tmp) {
                         *tmp = '-';
                     }
                     else {
                         *tmp = JK_TOLOWER(*tmp);
                     }
+#endif
                     tmp++;
                 }
                 *tmp = '\0';



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


Mime
View raw message