]> git.ipfire.org Git - thirdparty/squid.git/commit - src/http.cc
Bug #1981 fix: Tell FwdState that an unregistered and failed Server is
authorrousskov <>
Wed, 20 Jun 2007 02:27:00 +0000 (02:27 +0000)
committerrousskov <>
Wed, 20 Jun 2007 02:27:00 +0000 (02:27 +0000)
commit3e8c047e09185a5ca69ebf9ee0a3035c73e92cc5
tree57084426b412a9ed2ed3f1098bb1e9777f4063c8
parent06a0fbd33e9f2f26a70c789a162aac0318c02fbb
Bug #1981 fix: Tell FwdState that an unregistered and failed Server is
gone.

When a Server unregisters its fd (by calling FwdState::unregister) and
then fails, call FwdState::handleUnregisteredServerEnd to tell FwdState
that the server is done working, so that the transaction does not get
stuck waiting for the server to call FwdState::complete. The old code
would just set Server's FwdState pointer to NULL which was only enough
if FwdState::self was already NULL due to aborts.

This change fixed the bug in my limited ICAP tests.

The whole FwdState relationship with Servers needs a serious revision as
similar bugs probably do (or will) exist. We probably need to maintain a
state variable representing the relationship. The following Server
states are possible, at least: got valid FD and working, closed FD but
still working, stopped working (failure or success). FwdState needs to
be notified when we stopped working. Currently, when Server closes the
FD, deep down the Server stack, it may not be clear whether the Server
is still working or not.

Finally, it may be a good idea for FwdState to notify Server when
FwdState is aborted. Currently, the Server must check that the store
entry is still valid to notice the abort, and it sometimes forgets to do
that, causing store assertions.
src/forward.cc
src/forward.h
src/ftp.cc
src/http.cc