]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix max-stale in default refresh_pattern (#1664)
authorAlex Rousskov <rousskov@measurement-factory.com>
Thu, 8 Feb 2024 22:03:44 +0000 (22:03 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 10 Feb 2024 17:32:01 +0000 (17:32 +0000)
commit541ecc09140f804b6cc8c384b410822de1539ea4
tree09309cd64f6ab7b450c4348fc04de069cbd0e6fc
parentd920d4f9c076dfa574a5c820d05b059aa6a6dbc0
Fix max-stale in default refresh_pattern (#1664)

RefreshPattern constructor must set data fields to honor refresh_pattern
defaults promised in squid.conf.documented. For max-stale, that implies
making max_stale negative. A negative value allows refreshCheck() to use
a max_stale directive value (i.e. Config.maxStale that defaults to 1
week). The buggy constructor set max_stale to 0 instead and, hence,
refreshCheck() ignored max_stale directive when no refresh_pattern rules
were configured.

The fixed bug did not affect Squids configured using explicit
refresh_pattern rules because those rules are handled by
parse_refreshpattern() which sets max_stale to -1 by default. Our
squid.conf.default does have explicit refresh_pattern rules.
src/RefreshPattern.h