]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Close active pconns after their *_port goes away on reconfigure.
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 29 Aug 2014 06:59:17 +0000 (09:59 +0300)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Fri, 29 Aug 2014 06:59:17 +0000 (09:59 +0300)
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.

src/client_side_reply.cc

index fbbaf7997dc156723ca22b3ad152da7062ce709f..d8a5b95d0be2973ccdb63bceada4e4f6ca5b5d0c 100644 (file)
@@ -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