From: serassio <> Date: Tue, 15 Feb 2005 05:12:57 +0000 (+0000) Subject: Bug #1216: 2.5.STABLE8-RC2 enhanced cache.log : httpProcessReplyHeader message X-Git-Tag: SQUID_3_0_PRE4~869 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82384411a018896fd2c9d59974ef19a8a21fc0dc;p=thirdparty%2Fsquid.git Bug #1216: 2.5.STABLE8-RC2 enhanced cache.log : httpProcessReplyHeader message Forward port of 2.5 patch. --- diff --git a/src/http.cc b/src/http.cc index 66ab3807bb..1d397976bc 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.443 2005/01/06 13:16:39 serassio Exp $ + * $Id: http.cc,v 1.444 2005/02/14 22:12:57 serassio Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -643,6 +643,7 @@ HttpStateData::processReplyHeader(const char *buf, int size) * not do */ HttpReply *reply = httpReplyCreate(); + Ctx ctx = ctx_enter(entry->mem_obj->url); debug(11, 3) ("httpProcessReplyHeader: key '%s'\n", entry->getMD5Text()); @@ -663,6 +664,7 @@ HttpStateData::processReplyHeader(const char *buf, int size) reply_hdr_state += 2; memBufClean(&reply_hdr); failReply (reply, HTTP_INVALID_HEADER); + ctx_exit(ctx); return; } @@ -680,6 +682,10 @@ HttpStateData::processReplyHeader(const char *buf, int size) failReply (reply, HTTP_HEADER_TOO_LARGE); + reply_hdr_state += 2; + + ctx_exit(ctx); + return; } @@ -687,8 +693,10 @@ HttpStateData::processReplyHeader(const char *buf, int size) if (!hdr_size) { if (eof) hdr_size = hdr_len; - else + else { + ctx_exit(ctx); return; /* headers not complete */ + } } /* Cut away any excess body data (only needed for debug?) */ @@ -700,8 +708,6 @@ HttpStateData::processReplyHeader(const char *buf, int size) assert(reply_hdr_state == 1); - Ctx ctx = ctx_enter(entry->mem_obj->url); - reply_hdr_state++; debug(11, 9) ("GOT HTTP REPLY HDR:\n---------\n%s\n----------\n", @@ -714,6 +720,7 @@ HttpStateData::processReplyHeader(const char *buf, int size) if (reply->sline.status >= HTTP_INVALID_HEADER) { debugs(11, 3, "httpProcessReplyHeader: Non-HTTP-compliant header: '" << reply_hdr.buf << "'"); failReply (reply, HTTP_INVALID_HEADER); + ctx_exit(ctx); return; }