]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r579707 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 27 Sep 2007 13:08:36 +0000 (13:08 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 27 Sep 2007 13:08:36 +0000 (13:08 +0000)
Ignore any ajp13 flush messages which we may mistakenly
rec' before we send the response headers. See
Tomcat PR 43478.

Reviewed by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@579999 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/proxy/mod_proxy_ajp.c

diff --git a/CHANGES b/CHANGES
index a553349d9a5b3fd983eb8f64ae12ed5912e0efff..91ea40d7a0051a5b4cc0b41de433aff101dadcc1 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                         -*- coding: utf-8 -*-
 Changes with Apache 2.2.7
 
+  *) mod_proxy_ajp: Ignore any ajp13 flush packets received before
+     we send the response headers. See Tomcat PR 43478.
+     [Jim Jagielski]
+
   *) mod_proxy_balancer: Do not reset lbstatus, lbfactor and lbset when
      starting a new child.
      PR 39907 [Vinicius Petrucci <vpetrucci gmail.com>, Ruediger Pluem]
diff --git a/STATUS b/STATUS
index df6cba8504df05797a693830aa8454dc414d7bd7..e7fba2762a519722b25e911dc6ffbfe74ebb43c2 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -79,13 +79,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_proxy_ajp: Ignore any ajp13 flush packets that we may
-     receive before we send headers.
-     Trunk version of patch:
-        http://svn.apache.org/viewvc?view=rev&revision=579707
-      Backport version for 2.2.x of patch:
-         Trunk version of patch works (minus CHANGES conflict)
-      +1: jim, rpluem, jfclere
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index d02b4364d735050d23dc6b71c83a33483a27b350..bad2b26e8c04225c4ba6920cdeec2f54801deb63 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,