From: Ruediger Pluem Date: Thu, 23 Dec 2010 11:10:56 +0000 (+0000) Subject: * Do not fiddle around with the close field if we might have returned the X-Git-Tag: 2.3.11~353 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23bc3de91b9a7a4634eb1a7c70e2c5110125048d;p=apache * Do not fiddle around with the close field if we might have returned the connection to the pool already. It might be already in use again by another thread. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1052224 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 61d59252ac..d523e16d09 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1946,7 +1946,9 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, if (ap_pass_brigade(r->output_filters, pass_bb) != APR_SUCCESS || c->aborted) { /* Ack! Phbtt! Die! User aborted! */ - backend->close = 1; /* this causes socket close below */ + if (!backend->cleaned) { + backend->close = 1; /* this causes socket close below */ + } finish = TRUE; } @@ -1974,11 +1976,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, /* Pass EOS bucket down the filter chain. */ e = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(bb, e); - if (ap_pass_brigade(r->output_filters, bb) != APR_SUCCESS - || c->aborted) { - /* Ack! Phbtt! Die! User aborted! */ - backend->close = 1; /* this causes socket close below */ - } + ap_pass_brigade(r->output_filters, bb); apr_brigade_cleanup(bb); } @@ -2162,7 +2160,7 @@ static int proxy_http_handler(request_rec *r, proxy_worker *worker, /* Step Six: Clean Up */ cleanup: if (backend) { - if (status != OK) + if ((status != OK) && (!backend->cleaned)) backend->close = 1; ap_proxy_http_cleanup(proxy_function, r, backend); }