]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not reuse a persistent ICAP connection if icap_persistent_connections in
authorrousskov <>
Tue, 22 May 2007 23:43:40 +0000 (23:43 +0000)
committerrousskov <>
Tue, 22 May 2007 23:43:40 +0000 (23:43 +0000)
squid.conf (i.e., TheICAPConfig.reuse_connections) is off. We were probably
not reusing before this change except shortly after reconfiguration and in
cases where an ICAP server does not respond with Connection: close when our
request has Connection: close.

src/ICAP/ICAPXaction.cc

index 0156d33d6c142a6fbd0fe739e7577df85f7f3159..f0460dbd474accbd46073378a2826361ef1827c6 100644 (file)
@@ -6,6 +6,7 @@
 #include "comm.h"
 #include "HttpMsg.h"
 #include "ICAPXaction.h"
+#include "ICAPConfig.h"
 #include "TextException.h"
 #include "pconn.h"
 #include "fde.h"
@@ -102,6 +103,9 @@ void ICAPXaction::openConnection()
 
     const ICAPServiceRep &s = service();
 
+    if (!TheICAPConfig.reuse_connections)
+        disableRetries(); // this will also safely drain pconn pool
+
     // TODO: check whether NULL domain is appropriate here
     connection = icapPconnPool->pop(s.host.c_str(), s.port, NULL, NULL, isRetriable);
     if (connection >= 0) {