From a1a3d3820c4a98fb4fdad8e6e388b9cc2f7ebb06 Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Sun, 7 Nov 2010 18:54:44 +0000 Subject: [PATCH] mark connection for close after the return from ap_proxy_determine_connection() before this revision: if there was an existing connection, ap_proxy_determine_connection() would close it but then clear the close flag, so it didn't get closed by ap_proxy_release_connection() thus, if this child process doesn't use the connection for a while, the application could be stuck in read() for the same while after: ap_proxy_release_connection() will close it after the request completes git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032345 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy_fcgi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index a89bc85a4e..457ad9b1bd 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -961,13 +961,6 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, backend->is_ssl = 0; - /* XXX Setting close to 0 is a great way to end up with - * timeouts at this point, since we lack good ways to manage the - * back end fastcgi processes. This should be revisited when we - * have a better story on that part of things. */ - - backend->close = 1; - /* Step One: Determine Who To Connect To */ status = ap_proxy_determine_connection(p, r, conf, worker, backend, uri, &url, proxyname, proxyport, @@ -977,6 +970,12 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, goto cleanup; } + /* XXX Setting close to 0 is a great way to end up with + * timeouts at this point, since we lack good ways to manage the + * back end fastcgi processes. This should be revisited when we + * have a better story on that part of things. */ + backend->close = 1; + /* Step Two: Make the Connection */ if (ap_proxy_connect_backend(FCGI_SCHEME, backend, worker, r->server)) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, @@ -991,7 +990,6 @@ static int proxy_fcgi_handler(request_rec *r, proxy_worker *worker, server_portstr); cleanup: - /* Do not close the socket */ ap_proxy_release_connection(FCGI_SCHEME, backend, r->server); return status; } -- 2.40.0