]> git.ipfire.org Git - thirdparty/squid.git/commit
Stop processing a response if the Store entry is gone (#806)
authorAlex Rousskov <rousskov@measurement-factory.com>
Mon, 3 May 2021 21:40:14 +0000 (21:40 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 7 May 2021 09:38:14 +0000 (21:38 +1200)
commitc36a676d40aeb0b72add969afb19b3fb20f4bd62
tree3b1a96b21e79fc58ec57c14b75e252e4a2d3d38e
parent0003e3518dc95e4b5ab46b5140af79b22253048e
Stop processing a response if the Store entry is gone (#806)

HttpStateData::processReply() is usually called synchronously, after
checking the Store entry status, but there are other call chains.

StoreEntry::isAccepting() adds STORE_PENDING check to the ENTRY_ABORTED
check. An accepting entry is required for writing into Store. In theory,
an entry may stop accepting new writes (without being aborted) if
FwdState or another entry co-owner writes an error response due to a
timeout or some other problem that happens while we are waiting for an
I/O callback or some such.

N.B. HTTP and FTP code cannot use StoreEntry::isAccepting() directly
because their network readers may not be the ones writing into Store --
the content may go through the adaptation layer first and that layer
might complete the store entry before the entire peer response is
received. For example, imagine an adaptation service that wants to log
the whole response containing a virus but also replaces that (large)
response with a small error reply.
src/gopher.cc
src/http.cc
src/urn.cc
src/whois.cc