]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Enable negative cacheing on unknown or -1 expiry timestamp
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 21 Jul 2011 12:02:28 +0000 (00:02 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 21 Jul 2011 12:02:28 +0000 (00:02 +1200)
This syncs the squid-3 code with what squid-2 does. THere seem to be no
problems in squid-2, but squid-3 does not cache at times when it should
according to negative_ttl

src/store.cc

index 94e382e6633a0f754df8c14ee376d86a03e8dc81..039903cd30fd6ddb982170d88c720c9d84331211 100644 (file)
@@ -1448,7 +1448,9 @@ StoreEntry::checkNegativeHit() const
 void
 StoreEntry::negativeCache()
 {
-    if (expires == 0)
+    // XXX: should make the default for expires 0 instead of -1
+    //      so we can distinguish "Expires: -1" from nothing.
+    if (expires <= 0)
 #if USE_HTTP_VIOLATIONS
         expires = squid_curtime + Config.negativeTtl;
 #else