From: serassio <> Date: Sat, 12 Mar 2005 03:50:09 +0000 (+0000) Subject: Bug #1262: Duplicate content-length headers logged as conflicting with X-Git-Tag: SQUID_3_0_PRE4~850 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b3123159c2461556ef6afef29fb71e90c28e4557;p=thirdparty%2Fsquid.git Bug #1262: Duplicate content-length headers logged as conflicting with relaxed_header_parser off also forgot to clean up duplicate content-length headers with relaxed_header_parser enabled (on/warn) Forward port of 2.5 patch. --- diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 718b18de42..1bba6ba58a 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.102 2005/03/06 14:46:29 serassio Exp $ + * $Id: HttpHeader.cc,v 1.103 2005/03/11 20:50:09 serassio Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -555,13 +555,21 @@ httpHeaderParse(HttpHeader * hdr, const char *header_start, const char *header_e } if (e->id == HDR_CONTENT_LENGTH && (e2 = httpHeaderFindEntry(hdr, e->id)) != NULL) { - if (!Config.onoff.relaxed_header_parser || e->value.cmp(e2->value.buf()) != 0) { + if (e->value.cmp(e2->value.buf()) != 0) { debug(55, 1) ("WARNING: found two conflicting content-length headers in {%s}\n", getStringPrefix(header_start, header_end)); httpHeaderEntryDestroy(e); return httpHeaderReset(hdr); } else { debug(55, Config.onoff.relaxed_header_parser <= 0 ? 1 : 2) ("NOTICE: found double content-length header\n"); + + if (Config.onoff.relaxed_header_parser) { + httpHeaderEntryDestroy(e); + continue; + } else { + httpHeaderEntryDestroy(e); + return httpHeaderReset(hdr); + } } }