summaryrefslogtreecommitdiffstats
path: root/modules/proxy/mod_proxy_http.c
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2010-10-23 21:26:44 +0200
committerGraham Leggett <minfrin@apache.org>2010-10-23 21:26:44 +0200
commit9d58cd69902b69f2ebea62128a9319a5626abd32 (patch)
tree11e4a0daacef4b12ad10d2677289e67ffc9fd250 /modules/proxy/mod_proxy_http.c
parentmore temp pool usage and remove some useless apr_pstrdup()s (diff)
downloadapache2-9d58cd69902b69f2ebea62128a9319a5626abd32.tar.xz
apache2-9d58cd69902b69f2ebea62128a9319a5626abd32.zip
mod_proxy: Release the backend connection as soon as EOS is detected,
so the backend isn't forced to wait for the client to eventually acknowledge the data. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026665 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/proxy/mod_proxy_http.c')
-rw-r--r--modules/proxy/mod_proxy_http.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c
index e636b73074..9454758d71 100644
--- a/modules/proxy/mod_proxy_http.c
+++ b/modules/proxy/mod_proxy_http.c
@@ -1905,8 +1905,18 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
/* found the last brigade? */
if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
+
/* signal that we must leave */
finish = TRUE;
+
+ /* make sure we release the backend connection as soon
+ * as we know we are done, so that the backend isn't
+ * left waiting for a slow client to eventually
+ * acknowledge the data.
+ */
+ ap_proxy_release_connection(backend->worker->scheme,
+ backend, r->server);
+
}
/* try send what we read */
@@ -1930,6 +1940,14 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, r->server,
"proxy: header only");
+ /* make sure we release the backend connection as soon
+ * as we know we are done, so that the backend isn't
+ * left waiting for a slow client to eventually
+ * acknowledge the data.
+ */
+ ap_proxy_release_connection(backend->worker->scheme,
+ backend, r->server);
+
/* Pass EOS bucket down the filter chain. */
e = apr_bucket_eos_create(c->bucket_alloc);
APR_BRIGADE_INSERT_TAIL(bb, e);