From: Yann Ylavic Date: Fri, 18 Sep 2015 10:58:58 +0000 (+0000) Subject: mod_proxy: don't recyle backend announced "Connection: close" connections. X-Git-Tag: 2.5.0-alpha~2831 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cef0bb5ac51d7f13b602d191efcad61b5865cc66;p=apache mod_proxy: don't recyle backend announced "Connection: close" connections. Failing to do this may lead to a race condition where we send a new request before the backend really closes the connection (or lost SSL-Alert/FIN make us think the connection is still alive, until the retransmission). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1703807 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 94eb3c20e7..1aebd2467a 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1396,7 +1396,9 @@ static apr_status_t connection_cleanup(void *theconn) apr_pool_create(&(conn->scpool), p); apr_pool_tag(conn->scpool, "proxy_conn_scpool"); } - else if (conn->close) { + else if (conn->close + || (conn->connection + && conn->connection->keepalive == AP_CONN_CLOSE)) { socket_cleanup(conn); conn->close = 0; }