From: Alex Rousskov Date: Fri, 9 Sep 2011 16:33:54 +0000 (-0600) Subject: Fixed max-stale check. Entities not exceeding max-stale were marked as stale. X-Git-Tag: take08~4^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60c3d5b748b63f887ccb314b095fb4e0137f6edd;p=thirdparty%2Fsquid.git Fixed max-stale check. Entities not exceeding max-stale were marked as stale. 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. --- diff --git a/src/refresh.cc b/src/refresh.cc index 4617102a8e..d16915a401 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -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;