From: Ruediger Pluem Date: Thu, 8 Sep 2011 10:31:44 +0000 (+0000) Subject: Merge r1153531 from trunk: X-Git-Tag: 2.2.21~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=754fc714aca30c3f6c1240cc034c757df831a390;p=thirdparty%2Fapache%2Fhttpd.git Merge r1153531 from trunk: * Do not even sent an empty brigade down the filter chain if the headers have not been sent by the AJP server so far. Even an empty brigade will trigger the headers filter to create the (in this case incomplete) HTTP headers of the response. PR: 51608 Submitted by: rpluem Reviewed by: rpluem, jim, jfclere git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1166611 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index d8948175f62..0f944900697 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.21 + *) mod_proxy_ajp: Ignore flushing if headers have not been sent. + PR 51608 [Ruediger Pluem] + *) Fix a regression in the CVE-2011-3192 byterange fix. PR 51748. [low_priority ] diff --git a/STATUS b/STATUS index 884b42ddbeb..b3e27ae2170 100644 --- a/STATUS +++ b/STATUS @@ -102,11 +102,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: (Accept-Range: changeset in separate proposal below) +1: covener, wrowe, rpluem - * mod_proxy_ajp: Ignore flushing if headers have not been sent. - Trunk patch: http://svn.apache.org/viewvc?rev=1153531&view=rev - 2.2.x patch: http://people.apache.org/~rpluem/patches/51608.diff - +1: rpluem, jim, jfclere - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index 1b1fdf650e2..0d8095fa598 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -470,16 +470,18 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, if (bb_len != -1) conn->worker->s->read += bb_len; } - if (ap_pass_brigade(r->output_filters, - output_brigade) != APR_SUCCESS) { - ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, - "proxy: error processing body.%s", - r->connection->aborted ? - " Client aborted connection." : ""); - output_failed = 1; + if (headers_sent) { + if (ap_pass_brigade(r->output_filters, + output_brigade) != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, + "proxy: error processing body.%s", + r->connection->aborted ? + " Client aborted connection." : ""); + output_failed = 1; + } + data_sent = 1; + apr_brigade_cleanup(output_brigade); } - data_sent = 1; - apr_brigade_cleanup(output_brigade); } else { backend_failed = 1;