]> granicus.if.org Git - apache/commitdiff
* Do not fiddle around with the close field if we might have returned the
authorRuediger Pluem <rpluem@apache.org>
Thu, 23 Dec 2010 11:10:56 +0000 (11:10 +0000)
committerRuediger Pluem <rpluem@apache.org>
Thu, 23 Dec 2010 11:10:56 +0000 (11:10 +0000)
  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

modules/proxy/mod_proxy_http.c

index 61d59252ac670586d26a8a810a7632353f62d7fe..d523e16d09d98c189233efa78bc5abc55081a657 100644 (file)
@@ -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);
     }