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.
#include "comm.h"
#include "HttpMsg.h"
#include "ICAPXaction.h"
+#include "ICAPConfig.h"
#include "TextException.h"
#include "pconn.h"
#include "fde.h"
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) {