]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed max-stale check. Entities not exceeding max-stale were marked as stale.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 Sep 2011 16:33:54 +0000 (10:33 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 Sep 2011 16:33:54 +0000 (10:33 -0600)
Since the fixed check is performed for entities already suspected of being
stale by refreshCheck(), it is difficult to describe exactly which entities
were affected by the bug. A rough description would be "entities which would
otherwise qualify for a FRESH_OVERRIDE_EXPIRES or FRESH_OVERRIDE_LASTMOD
exceptions located below the fixed check.

Other concerns about staleness checks have been discussed on squid-dev's
"max_stale broken?" email thread.

src/refresh.cc

index 4617102a8e30750df539ae643d5cc3430ff0a602..d16915a401402f79dfb49a120d746faa8a84fb6b 100644 (file)
@@ -392,7 +392,7 @@ refreshCheck(const StoreEntry * entry, HttpRequest * request, time_t delta)
      * NOTE: max-stale config blocks the overrides.
      */
     int max_stale = (R->max_stale >= 0 ? R->max_stale : Config.maxStale);
-    if ( max_stale >= 0 && staleness < max_stale) {
+    if ( max_stale >= 0 && staleness > max_stale) {
         debugs(22, 3, "refreshCheck: YES: max-stale limit");
         if (request)
             request->flags.fail_on_validation_err = 1;