]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not check store_status when checking ENTRY_BAD_LENGTH (#1342)
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 3 May 2023 22:20:27 +0000 (22:20 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 5 May 2023 22:35:45 +0000 (22:35 +0000)
commit665f2f8534f98ea979ed1190e79612f3cb5dc15a
treedad9880bfc2c1d467fdb63c84a5415802d663b74
parent2519a7b6c680e36c1fcf1ff9023e0f8e47d3006c
Do not check store_status when checking ENTRY_BAD_LENGTH (#1342)

Before 1997 commit b34ed72 (that introduced the current ENTRY_BAD_LENGTH
"cache"), checking store_status before calling storeEntryValidLength()
kind of made sense because storeEntryValidLength() did not support
STORE_PENDING entries with their unset object_len. Since that commit,
checking store_status does not cause any visible problems (i.e. the code
"works") because ENTRY_BAD_LENGTH implies STORE_OK. However, that
implication is not backed by some fundamental invariant and might
suddenly disappear. Checking two flags instead of one is also wasteful.

No Squid functionality changes are expected.
src/store.cc
src/store_digest.cc