]> git.ipfire.org Git - thirdparty/squid.git/commit
Do not blame cache_peer for 4xx CONNECT responses (#1166)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sun, 13 Nov 2022 16:00:21 +0000 (16:00 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 13 Nov 2022 19:33:43 +0000 (19:33 +0000)
commit022dbabd89249f839d1861aa87c1ab9e1a008a47
tree622364a5e7c30ddb6650f355daf8c52159583275
parent3a6c07a6fe40e898c432f93f3e16447be5b3a858
Do not blame cache_peer for 4xx CONNECT responses (#1166)

To avoid using a problematic cache_peer, Squid penalizes cache_peers for
a variety of problems. However, a problem like an HTTP 403 Forbidden
response may be caused by the client or other factors unrelated to the
cache_peer that sent the response to Squid. In those cases, the
cache_peer is not at fault and should not be marked dead, even after
many such responses.

This change stops blaming cache_peers for HTTP 4xx outcomes of Squid
CONNECT requests. Currently, such outcomes only happen when a cache_peer
responds with a 4xx reply, but the new code also treats Squid-generated
4xx error responses (while trying to establish a connection to the
cache_peer) the same way.

This hard-coded logic covers known use cases. If different use cases
surface, we can make Squid behavior configurable.

Co-authored-by: Amos Jeffries <squid3@treenet.co.nz>
17 files changed:
src/CachePeer.cc
src/CachePeer.h
src/FwdState.cc
src/FwdState.h
src/HappyConnOpener.cc
src/PeerPoolMgr.cc
src/clients/HttpTunneler.cc
src/clients/HttpTunneler.h
src/error/forward.h
src/http/StatusCode.h
src/neighbors.cc
src/neighbors.h
src/security/BlindPeerConnector.cc
src/security/BlindPeerConnector.h
src/security/PeerConnector.cc
src/security/PeerConnector.h
src/tests/stub_libsecurity.cc