From: Jim Jagielski Date: Wed, 26 Sep 2007 16:11:07 +0000 (+0000) Subject: Ignore any ajp13 flush messages which we may mistakenly X-Git-Tag: 2.3.0~1392 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a067e75531db415127b6350d1181c799d3c7cbcf;p=thirdparty%2Fapache%2Fhttpd.git Ignore any ajp13 flush messages which we may mistakenly 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 --- diff --git a/CHANGES b/CHANGES index dbf96658488..54498693d72 100644 --- 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 ] diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 83ba021db4d..99d9cf14321 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -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,