]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Append "Connection: close" to OPTIONS requests when icap_persistent_connections
authorNathan Hoad <nathan@getoffmalawn.com>
Fri, 18 Oct 2013 23:52:10 +0000 (17:52 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 18 Oct 2013 23:52:10 +0000 (17:52 -0600)
is off.

This brings OPTIONS requests behavior inline with REQMOD and RESPMOD.

src/adaptation/icap/OptXact.cc

index e092d728434f89a95cac4cc2349c04eaed0d3a43..7fe04dd254cc147e7b88e4cd4093501fc27e8321 100644 (file)
@@ -51,6 +51,10 @@ void Adaptation::Icap::OptXact::makeRequest(MemBuf &buf)
     buf.Printf("OPTIONS " SQUIDSTRINGPH " ICAP/1.0\r\n", SQUIDSTRINGPRINT(uri));
     const String host = s.cfg().host;
     buf.Printf("Host: " SQUIDSTRINGPH ":%d\r\n", SQUIDSTRINGPRINT(host), s.cfg().port);
+
+    if (!TheConfig.reuse_connections)
+        buf.Printf("Connection: close\r\n");
+
     if (TheConfig.allow206_enable)
         buf.Printf("Allow: 206\r\n");
     buf.append(ICAP::crlf, 2);