You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ti...@apache.org on 2010/11/29 11:42:16 UTC

svn commit: r1040059 - /tomcat/jk/trunk/native/iis/jk_isapi_plugin.c

Author: timw
Date: Mon Nov 29 10:42:15 2010
New Revision: 1040059

URL: http://svn.apache.org/viewvc?rev=1040059&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50363
Handle 204, 205 and 304 responses with empty message bodies correctly (by not chunk encoding the body).

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

Modified: tomcat/jk/trunk/native/iis/jk_isapi_plugin.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/iis/jk_isapi_plugin.c?rev=1040059&r1=1040058&r2=1040059&view=diff
==============================================================================
--- tomcat/jk/trunk/native/iis/jk_isapi_plugin.c (original)
+++ tomcat/jk/trunk/native/iis/jk_isapi_plugin.c Mon Nov 29 10:42:15 2010
@@ -993,10 +993,19 @@ static int JK_METHOD start_response(jk_w
                 len_of_headers += 4;   /* extra for colon, space and crlf */
             }
 
+            /*
+             * Exclude status codes that MUST NOT include message bodies
+             */
+            if ((status == 204) || (status == 205) || (status == 304)) {
+                p->chunk_content = JK_FALSE;
+                /* Keep alive is still possible */
+                if (JK_IS_DEBUG_LEVEL(logger))
+                    jk_log(logger, JK_LOG_DEBUG, "Response status %d implies no message body", status );
+            }
             if (p->chunk_content) {
                 for (i = 0; i < num_of_headers; i++) {
                     /* Check the downstream response to see whether
-                     * it's appropriate the chunk the response content
+                     * it's appropriate to chunk the response content
                      * and whether it supports keeping the connection open.
 
                      * This implements the rules for HTTP/1.1 message length determination



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