]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Alex Rousskov <rousskov@measurement-factory.com>
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 1 Aug 2010 12:50:32 +0000 (06:50 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sun, 1 Aug 2010 12:50:32 +0000 (06:50 -0600)
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

src/HttpHdrCc.cc

index 6e91e83b7eaff076e5c8369257b73aa8b48f90bf..cc9356bad015dc595a0d1433877a104711025944 100644 (file)
@@ -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) {