From fc764d26dcb83043c6659a13d84e303afdf6ea66 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Tue, 20 Dec 2005 12:23:59 +0000 Subject: [PATCH] The check for "connection: close" in the ICAP header belongs in parseIcapHead() rather than parseHead(). --- src/ICAP/ICAPModXact.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/ICAP/ICAPModXact.cc b/src/ICAP/ICAPModXact.cc index 30ed865c07..bd99d9f54d 100644 --- a/src/ICAP/ICAPModXact.cc +++ b/src/ICAP/ICAPModXact.cc @@ -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; } -- 2.47.2