]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix debugging for responses that Expire at check time (#1683)
authorAlex Rousskov <rousskov@measurement-factory.com>
Sun, 18 Feb 2024 00:45:41 +0000 (00:45 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 18 Feb 2024 21:57:39 +0000 (21:57 +0000)
Since 2000 commit 65fa5c6, our level-3 debugging mislead about Expires
being less than the check time when the two times were identical. The
actual checked conditions are correct: Roughly speaking, the response
with Expires value T is considered expired at that time T.

Also dropped extra (and inconsistent) trailing space on debugs() lines.
This space was added by the same 2000 commit, probably accidentally.

src/refresh.cc

index 7e83fe2a0456568fb44c07d75a0c57ada43711ef..3e48cc0861e6eaed6d47889e7da18a22f42d51c8 100644 (file)
@@ -144,14 +144,10 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age,
         sf->expires = true;
 
         if (entry->expires > check_time) {
-            debugs(22, 3, "FRESH: expires " << entry->expires <<
-                   " >= check_time " << check_time << " ");
-
+            debugs(22, 3, "FRESH: expires " << entry->expires << " > check_time " << check_time);
             return -1;
         } else {
-            debugs(22, 3, "STALE: expires " << entry->expires <<
-                   " < check_time " << check_time << " ");
-
+            debugs(22, 3, "STALE: expires " << entry->expires << " <= check_time " << check_time);
             return (check_time - entry->expires);
         }
     }
@@ -160,7 +156,7 @@ refreshStaleness(const StoreEntry * entry, time_t check_time, const time_t age,
 
     // 2. If the entry is older than the maximum age in the refresh_pattern, it is STALE.
     if (age > R->max) {
-        debugs(22, 3, "STALE: age " << age << " > max " << R->max << " ");
+        debugs(22, 3, "STALE: age " << age << " > max " << R->max);
         sf->max = true;
         return (age - R->max);
     }