]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
The check for "connection: close" in the ICAP header
authorwessels <>
Tue, 20 Dec 2005 12:23:59 +0000 (12:23 +0000)
committerwessels <>
Tue, 20 Dec 2005 12:23:59 +0000 (12:23 +0000)
belongs in parseIcapHead() rather than parseHead().

src/ICAP/ICAPModXact.cc

index 30ed865c079ff604ebac7e2bd46f3b0dd924159d..bd99d9f54d13d249ad67d3124ff80826a7cba607 100644 (file)
@@ -574,6 +574,11 @@ void ICAPModXact::parseIcapHead()
     if (!parseHead(icapReply))
         return;
 
+    if (httpHeaderHasConnDir(&icapReply->header, "close")) {
+        debugs(93, 5, HERE << "found connection close");
+        reuseConnection = false;
+    }
+
     switch (icapReply->sline.status) {
 
     case 100:
@@ -691,6 +696,9 @@ void ICAPModXact::parseHttpHead()
     state.parsing = State::psBody;
 }
 
+/*
+ * Common routine used to parse both HTTP and ICAP headers
+ */
 bool ICAPModXact::parseHead(HttpMsg *head)
 {
     assert(head);
@@ -706,11 +714,6 @@ bool ICAPModXact::parseHead(HttpMsg *head)
         return false;
     }
 
-    if (httpHeaderHasConnDir(&head->header, "close")) {
-        debug(93,5)("%s(%d) found connection close\n", __FILE__,__LINE__);
-        reuseConnection = false;
-    }
-
     readBuf.consume(head->hdr_sz);
     return true;
 }