]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3940 (partial): hostHeaderVerify failures MISS when they should be HIT
authorGarri Djavadyan <garryd@comnet.uz>
Wed, 7 Dec 2016 00:05:07 +0000 (13:05 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 7 Dec 2016 00:05:07 +0000 (13:05 +1300)
This fixes the critical condition leading to the HIT. However not all
code is correctly setting flags.noCache and flags.cacheable (see bugzilla).
So there may be other fixes needed after this.

src/client_side_reply.cc

index b7c236d1fec0f392fe3a2aa38215419ded478d4b..3459f3030f3a97d8c08d1ab4b987ca75f0139646 100644 (file)
@@ -1666,7 +1666,9 @@ clientReplyContext::identifyStoreObject()
 {
     HttpRequest *r = http->request;
 
-    if (r->flags.cachable || r->flags.internal) {
+    // client sent CC:no-cache or some other condition has been
+    // encountered which prevents delivering a public/cached object.
+    if (!r->flags.noCache || r->flags.internal) {
         lookingforstore = 5;
         StoreEntry::getPublicByRequest (this, r);
     } else {