mirror of
https://github.com/apache/httpd.git
synced 2025-08-07 04:02:58 +03:00
mod_proxy: Add ap_connection_reusable() for checking if a connection
is reusable as of this point in processing. mod_proxy_fcgi uses the new API to determine if FCGI_CONN_CLOSE should be enabled, but that doesn't change existing behavior since the connection is currently marked for closure elsewhere in the module. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1526189 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -1334,6 +1334,13 @@ static void init_conn_pool(apr_pool_t *p, proxy_worker *worker)
|
||||
worker->cp = cp;
|
||||
}
|
||||
|
||||
PROXY_DECLARE(int) ap_proxy_connection_reusable(proxy_conn_rec *conn)
|
||||
{
|
||||
proxy_worker *worker = conn->worker;
|
||||
|
||||
return ! (conn->close || !worker->s->is_address_reusable || worker->s->disablereuse);
|
||||
}
|
||||
|
||||
static apr_status_t connection_cleanup(void *theconn)
|
||||
{
|
||||
proxy_conn_rec *conn = (proxy_conn_rec *)theconn;
|
||||
@@ -1362,7 +1369,7 @@ static apr_status_t connection_cleanup(void *theconn)
|
||||
}
|
||||
|
||||
/* determine if the connection need to be closed */
|
||||
if (conn->close || !worker->s->is_address_reusable || worker->s->disablereuse) {
|
||||
if (!ap_proxy_connection_reusable(conn)) {
|
||||
apr_pool_t *p = conn->pool;
|
||||
apr_pool_clear(p);
|
||||
conn = apr_pcalloc(p, sizeof(proxy_conn_rec));
|
||||
|
Reference in New Issue
Block a user