]> git.ipfire.org Git - thirdparty/squid.git/commit
Fix "BUG: Lost previously bumped from-Squid connection" (#460)
authorChristos Tsantilas <christos@chtsanti.net>
Mon, 9 Sep 2019 14:14:50 +0000 (14:14 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 10 Sep 2019 01:49:24 +0000 (01:49 +0000)
commitdaf80700130b6f98256b75c511916d1a79b23597
tree313d440b50c5626fbe544cff0984127d5a729f06
parenta70e75b76a4e4c763abc64574d18e1859e54631f
Fix "BUG: Lost previously bumped from-Squid connection" (#460)

FwdState assumed that PeerSelector always returns the connection pinned
by previous SslBump steps. That assumption was wrong in two cases:

1. The previously pinned connection got closed.
2. PeerSelector policies prevent pinned connection reuse. For example,
    connection destination is now denied by cache_peer_access rules.

PeerSelector now returns a PINNED selection even if a pinned connection
cannot or should not be used. The initiator is now fully responsible for
checking the returned connection usability, including the new
ConnStateData::pinning::peerAccessDenied flag. Unusable pinned
connection is now treated as any other fatal (for the transaction)
forwarding problem rather than an internal BUG.

The above changes do not change traffic on the wire but remove bogus
level-1 BUG messages from cache.log.

We also polished which error page is returned depending on the pinning
validation problem: ERR_ZERO_SIZE_OBJECT is returned when the validation
failed because of the peer disappearance or to-server connection
closure. Other cases use ERR_CANNOT_FORWARD. Eventually, these errors
can be detailed further to distinguish various problems. We may also
want to generalize ERR_CONFLICT_HOST and/or ERR_FORWARDING_DENIED to
make them applicable in this context.

This is a Measurement Factory project.
src/FwdState.cc
src/client_side.cc
src/client_side.h
src/peer_select.cc
src/tests/stub_client_side.cc
src/tunnel.cc