From: Alex Rousskov Date: Fri, 30 Jul 2010 20:41:26 +0000 (-0600) Subject: Compliance: Forward multiple unknown HTTP Cache-Control directives. X-Git-Tag: take1~436 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=aa62670a5f4cf03006a073fe82e179480d8a327d;p=thirdparty%2Fsquid.git Compliance: Forward multiple unknown HTTP Cache-Control directives. httpHdrCcParseInit() ignored all unknown Cache-Control directives except for the first one because the (type != CC_OTHER) check applied to the debugging statement only. Co-Advisor test case: test_case/rfc2616/endHdr-fwd-set-Cache-Control-toSrv --- diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index 6e91e83b7e..cc9356bad0 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -138,18 +138,17 @@ httpHdrCcParseInit(HttpHdrCc * cc, const String * str) type = CC_OTHER; } + // ignore known duplicate directives if (EBIT_TEST(cc->mask, type)) { - if (type != CC_OTHER) + if (type != CC_OTHER) { debugs(65, 2, "hdr cc: ignoring duplicate cache-directive: near '" << item << "' in '" << str << "'"); - - CcFieldsInfo[type].stat.repCount++; - - continue; + CcFieldsInfo[type].stat.repCount++; + continue; + } + } else { + EBIT_SET(cc->mask, type); } - /* update mask */ - EBIT_SET(cc->mask, type); - /* post-processing special cases */ switch (type) {