]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 5279: FwdState.cc:279: "!storedWholeReply_" assertion (#2052)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Mon, 14 Apr 2025 09:40:33 +0000 (09:40 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 20 Apr 2025 12:30:54 +0000 (12:30 +0000)
commitd3e066e65b45737045198251affbc6dc22a9a481
tree21e498df61346ff67a2f95e58e9035059c4fc1e0
parentfefaea1e399d3d8d5e70fc40ddab6ad43fdbe5c4
Bug 5279: FwdState.cc:279: "!storedWholeReply_" assertion (#2052)

This assertion may be triggered when RESPMOD adaptation is aborted
(e.g., when an essential ICAP service is down, or when it sends an ICAP
response status code unsupported by Squid).

Ftp::Relay::forwardReply() calls markParsedVirginReplyAsWhole() before
adaptOrFinalizeReply(). Thus, at that markParsedVirginReplyAsWhole()
call time, startedAdaptation remained false, markStoredReplyAsWhole()
was called, and storedWholeReply_ became true. If Squid then decided to
start adaptation, but that adaptation had failed, FwdState::completed()
detected a mismatch between true storedWholeReply_ and a still-empty
STORE_PENDING StoreEntry. This bug was added in 2021 commit ba3fe8d.

Squid does not write virgin response to Store while adaptation_access
check is pending or after RESPMOD adaptation has started. Code that does
not write to Store must not make storedWholeReply_ true. On the other
hand, after adaptation_access is denied, and Squid finishes storing all
virgin response bytes, Squid needs to know whether storedWholeReply_
should be set (i.e. whether Squid has received the whole virgin reply
and called markParsedVirginReplyAsWhole()). This fix adds
Client::markedParsedVirginReplyAsWhole to remember the latter event.
src/clients/Client.cc
src/clients/Client.h