]> git.ipfire.org Git - thirdparty/squid.git/commit
Reduce crashes due to unexpected ClientHttpRequest termination.
authorChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 Jan 2017 18:17:47 +0000 (20:17 +0200)
committerChristos Tsantilas <chtsanti@users.sourceforge.net>
Wed, 11 Jan 2017 18:17:47 +0000 (20:17 +0200)
commit9d52ba1165dfa797b4fe688b49f0c10dc98e25a5
tree7d2cbaa10626342f34a8d241c3fded3779fdd5cb
parenta8ef0b3fde8f083923b49a7f06de90064cad7002
Reduce crashes due to unexpected ClientHttpRequest termination.

The underlying problem has been known since r13480: If a
ClientHttpRequest job ends without Http::Stream (and ConnStateData)
knowledge, then Squid is likely to segfault or assert. This patch does
not resolve the underlying issue (a proper fix would require
architectural changes in a consensus-lacking area) but makes an
unexpected ClientHttpRequest job destruction less likely.

BodyPipe and Adaptation-related exceptions are the major causes of
unexpected ClientHttpRequest job destruction. This patch handles them by
closing the client connection. Connection closure should trigger an
orderly top-down cleanup, including Http::Stream, ConnStateData, and
ClientHttpRequest destruction.

If there is no connection to close, then the exception is essentially
ignored with a level-1 error message disclosing the problem. The side
effects of ignoring such exceptions are unknown, but without a client
connection, it is our hope that they would be relatively benign.

This is a Measurement Factory project.
src/client_side_request.cc
src/client_side_request.h