From 560d7d2d1f04563486a14eda712d97f6afa66af0 Mon Sep 17 00:00:00 2001 From: rousskov <> Date: Tue, 22 May 2007 23:43:40 +0000 Subject: [PATCH] Do not reuse a persistent ICAP connection if icap_persistent_connections in 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ICAP/ICAPXaction.cc b/src/ICAP/ICAPXaction.cc index 0156d33d6c..f0460dbd47 100644 --- a/src/ICAP/ICAPXaction.cc +++ b/src/ICAP/ICAPXaction.cc @@ -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) { -- 2.47.3