]> git.ipfire.org Git - thirdparty/squid.git/commit - src/FwdState.h
Bug 4447:FwdState.cc:447 "serverConnection() == conn" assertion
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 29 Feb 2016 18:43:03 +0000 (20:43 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Mon, 29 Feb 2016 18:43:03 +0000 (20:43 +0200)
commit398bc06602eb8e7ab32170d6216aa6ddd32e33c4
treec8f3b81460b366bd58336b8bf49c72de21b19144
parentbb7082c2674d74f338157c91c5526e5a6d0c32e5
Bug 4447:FwdState.cc:447 "serverConnection() == conn" assertion

After certain failures, FwdState::retryOrBail() may be called twice,
once from FwdState::unregisterdServerEnd() [called from
HttpStateData::swanSong()] and once from the FwdState's own connection
close handler. This may result in two concurrent connections to the
remote server, followed by an assertion upon a connection closure.

This patch:

 - After HttpStateData failures, instead of closing the squid-to-peer
   connection directly (and, hence, triggering closure handlers), calls
   HttpStateData::closeServer() and mustStop() for a cleaner exit with
   fewer wasteful side effects and better debugging.

 - Creates and remembers a FwdState close handler AsyncCall so that
   comm_remove_close_handler() can cancel an already scheduled callback.
   The conversion to the AsyncCall was necessary because legacy [close
   handler callbacks] cannot be canceled once scheduled.

This is a Measurement Factory project.
src/FwdState.cc
src/FwdState.h
src/clients/Client.h
src/comm.cc
src/comm.h
src/http.cc