]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Ignore any ajp13 flush messages which we may mistakenly
authorJim Jagielski <jim@apache.org>
Wed, 26 Sep 2007 16:11:07 +0000 (16:11 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 26 Sep 2007 16:11:07 +0000 (16:11 +0000)
rec' before we send the response headers. See
Tomcat PR 43478.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@579707 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_ajp.c

diff --git a/CHANGES b/CHANGES
index dbf96658488c492eb96f8c875c71586c41ff6bfd..54498693d72d9f1a9714628bfb0b75048402491b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) mod_proxy_ajp: Ignore any ajp13 flush packets received before
+     we send the response headers. See Tomcat PR 43478.
+     [Jim Jagielski]
+
   *) core: reinstate location walk to fix config for subrequests
      PR 41960 [Jose Kahan <jose w3.org>]
 
index 83ba021db4d476b0532dfe15d280567dad56f06f..99d9cf14321d3ede3cddc8f440b2c45bfad4d72d 100644 (file)
@@ -131,6 +131,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
     int backend_failed = 0;
     apr_off_t bb_len;
     int data_sent = 0;
+    int headers_sent = 0;
     int rv = 0;
     apr_int32_t conn_poll_fd;
     apr_pollfd_t *conn_poll;
@@ -326,17 +327,24 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
                 if (status != APR_SUCCESS) {
                     backend_failed = 1;
                 }
+                headers_sent = 1;
                 break;
             case CMD_AJP13_SEND_BODY_CHUNK:
                 /* AJP13_SEND_BODY_CHUNK: piece of data */
                 status = ajp_parse_data(r, conn->data, &size, &buff);
                 if (status == APR_SUCCESS) {
+                    /* AJP13_SEND_BODY_CHUNK with zero length
+                     * is explicit flush message
+                     */
                     if (size == 0) {
-                        /* AJP13_SEND_BODY_CHUNK with zero length
-                         * is explicit flush message
-                         */
-                        e = apr_bucket_flush_create(r->connection->bucket_alloc);
-                        APR_BRIGADE_INSERT_TAIL(output_brigade, e);
+                        if (headers_sent) {
+                            e = apr_bucket_flush_create(r->connection->bucket_alloc);
+                            APR_BRIGADE_INSERT_TAIL(output_brigade, e);
+                        }
+                        else {
+                            ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
+                                 "Ignoring flush message received before headers");
+                        }
                     }
                     else {
                         e = apr_bucket_transient_create(buff, size,