From: rousskov <> Date: Tue, 22 May 2007 23:43:40 +0000 (+0000) Subject: Do not reuse a persistent ICAP connection if icap_persistent_connections in X-Git-Tag: SQUID_3_0_PRE7~241 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=560d7d2d1f04563486a14eda712d97f6afa66af0;p=thirdparty%2Fsquid.git 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. --- 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) {