]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3940 pt2: Make 'cache deny' do what is documented
authorAmos Jeffries <squid3@treenet.co.nz>
Mon, 26 Dec 2016 02:15:22 +0000 (15:15 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Mon, 26 Dec 2016 02:15:22 +0000 (15:15 +1300)
Instead of overriding whatever cacheability was previously set to
(including changing non-cacheables to be cacheable) actually
prevent both cache read and write.

This 'regression' appears after initial bug 3940 fix.

src/client_side_request.cc

index 027634acbf46e8b6a84d6841abbb28c8fb6eece8..b24eeedd3912b5bd016a112908d8e720793f7085 100644 (file)
@@ -1399,7 +1399,10 @@ void
 ClientRequestContext::checkNoCacheDone(const allow_t &answer)
 {
     acl_checklist = NULL;
-    http->request->flags.cachable = (answer == ACCESS_ALLOWED);
+    if (answer == ACCESS_DENIED) {
+        http->request->flags.noCache = true; // dont read reply from cache
+        http->request->flags.cachable = false; // dont store reply into cache
+    }
     http->doCallouts();
 }