]> granicus.if.org Git - apache/commitdiff
mark connection for close after the return from
authorJeff Trawick <trawick@apache.org>
Sun, 7 Nov 2010 18:54:44 +0000 (18:54 +0000)
committerJeff Trawick <trawick@apache.org>
Sun, 7 Nov 2010 18:54:44 +0000 (18:54 +0000)
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

index a89bc85a4ea804ad83bcc75bc2859978ab760cbe..457ad9b1bd45eb1de0654f0a053024befd50259a 100644 (file)
@@ -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;
 }