From: Ruediger Pluem Date: Wed, 12 Mar 2014 12:37:06 +0000 (+0000) Subject: Merge r1572543 from trunk: X-Git-Tag: 2.2.27~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c40fdde1e4253440e0bcd819fe4e8c3a0f39d527;p=thirdparty%2Fapache%2Fhttpd.git 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 by: ylavic, rpluem, wrowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1576714 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index ad279858a1d..ca3c5ee5fee 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -267,6 +267,9 @@ static int pass_brigade(apr_bucket_alloc_t *bucket_alloc, if (transferred != -1) 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_error(APLOG_MARK, APLOG_ERR, status, r->server, "proxy: pass request body failed to %pI (%s)", @@ -286,7 +289,6 @@ static int pass_brigade(apr_bucket_alloc_t *bucket_alloc, return HTTP_BAD_REQUEST; } } - apr_brigade_cleanup(bb); return OK; }