]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed a copy-paste typo in HttpHdrCc::hasMinFresh() (#901)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Fri, 24 Sep 2021 23:23:23 +0000 (23:23 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 24 Sep 2021 23:23:26 +0000 (23:23 +0000)
This bug could result in unexpected hits/misses because Squid used the
cached CC:max-stale value (or -1) instead of CC:min-fresh when
calculating entry freshness.

Broken since 810d879.

src/HttpHdrCc.h

index dc5506ce0499b9d00a122e8988a0da39338e543e..c79518831473b00c1e6045fb54a184af71f1f5b3 100644 (file)
@@ -137,7 +137,7 @@ public:
     void clearMaxStale() {setValue(max_stale,MAX_STALE_UNKNOWN,HttpHdrCcType::CC_MAX_STALE,false);}
 
     //manipulation for Cache-Control:min-fresh header
-    bool hasMinFresh(int32_t *val = nullptr) const { return hasDirective(HttpHdrCcType::CC_MIN_FRESH, max_stale, val); }
+    bool hasMinFresh(int32_t *val = nullptr) const { return hasDirective(HttpHdrCcType::CC_MIN_FRESH, min_fresh, val); }
     void minFresh(int32_t v) {if (v < 0) return; setValue(min_fresh,v,HttpHdrCcType::CC_MIN_FRESH); }
     void clearMinFresh() {setValue(min_fresh,MIN_FRESH_UNKNOWN,HttpHdrCcType::CC_MIN_FRESH,false);}