From: Jim Jagielski Date: Sun, 2 Mar 2014 20:18:03 +0000 (+0000) Subject: Merge r1572543 from trunk: X-Git-Tag: 2.4.8~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=56e539df70c832196d2b375bc1bc455b0e3351fe;p=apache Merge r1572543 from trunk: Cleanup the client to backend brigade before returning an error (if any) to avoid buckets lifetime issues (backend connection's pool destroyed before request's one). PR 50335. Suggested by rpluem. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1573359 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 1140a088f1..cbde2250f1 100644 --- a/STATUS +++ b/STATUS @@ -98,14 +98,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_proxy: Cleanup the client to backend brigade before returning an error - (if any) to avoid buckets lifetime issues (backend connection's - pool destroyed before request's one). PR 50335. - Follows up r1534321 and r1550061 already backported to 2.4.8. - trunk patch: http://svn.apache.org/r1572543 - 2.4.x patch: trunk works - +1: ylavic, jim, rpluem - * mod_ssl: Remove the hardcoded algorithm-type dependency for the SSLCertificateFile and SSLCertificateKeyFile directives, and deprecate SSLCertificateChainFile. A detailed list of the changes is included diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 526c7e1cf9..d05f0cdcce 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -3372,6 +3372,9 @@ PROXY_DECLARE(int) ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc, if (transferred != -1) p_conn->worker->s->transferred += transferred; status = ap_pass_brigade(origin->output_filters, bb); + /* Cleanup the brigade now to avoid buckets lifetime + * issues in case of error returned below. */ + apr_brigade_cleanup(bb); if (status != APR_SUCCESS) { ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, APLOGNO(01084) "pass request body failed to %pI (%s)", @@ -3391,7 +3394,6 @@ PROXY_DECLARE(int) ap_proxy_pass_brigade(apr_bucket_alloc_t *bucket_alloc, return HTTP_BAD_REQUEST; } } - apr_brigade_cleanup(bb); return OK; }