]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.cc
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)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 3 May 2021 21:40:18 +0000 (21:40 +0000)
commitd2b604ecafdc3cc6e2ad2b2b62c4befe0236ddaa
treeb16aef4a0fdb8ab23581218ae86062b18f93e7c7
parent26e65059bc06ebce508737b5cd0866478691566a
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