]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 2258: bypassing cache but not destroying cache entry
authorGarri Djavadyan <garryd@comnet.uz>
Tue, 6 Dec 2016 23:57:47 +0000 (12:57 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 6 Dec 2016 23:57:47 +0000 (12:57 +1300)
src/http.cc

index f985cdc936a8c3100cabb0c49a270a98f0bf6f60..102b9b0b198d112c7ca726944e796f4a063c5136 100644 (file)
@@ -189,6 +189,12 @@ httpMaybeRemovePublic(StoreEntry * e, Http::StatusCode status)
     if (!EBIT_TEST(e->flags, KEY_PRIVATE))
         return;
 
+    // If the new/incoming response cannot be stored, then it does not
+    // compete with the old stored response for the public key, and the
+    // old stored response should be left as is.
+    if (e->mem_obj->request && !e->mem_obj->request->flags.cachable)
+        return;
+
     switch (status) {
 
     case Http::scOkay: