From: Christos Tsantilas Date: Fri, 29 Aug 2014 06:59:17 +0000 (+0300) Subject: Close active pconns after their *_port goes away on reconfigure. X-Git-Tag: SQUID_3_5_0_1~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0aba3a66be37d6a32ce3d1029cbc3e39f19c115d;p=thirdparty%2Fsquid.git Close active pconns after their *_port goes away on reconfigure. This change reduces what may be perceived as reconfigure memory leaks related to *_port options. Before this change, a single persistent connection could continue to receive new requests (and tie no longer globally accessible PortCfg-related structures) for hours. TODO: Close already idle pconns as well. --- diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index fbbaf7997d..d8a5b95d0b 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1519,6 +1519,10 @@ clientReplyContext::buildReplyHeader() // The peer wants to close the pinned connection debugs(88, 3, "pinned reply forces close"); request->flags.proxyKeepalive = false; + } else if (http->getConn() && http->getConn()->port->listenConn == NULL) { + // The listening port closed because of a reconfigure + debugs(88, 3, "listening port closed"); + request->flags.proxyKeepalive = false; } // Decide if we send chunked reply