]> git.ipfire.org Git - thirdparty/squid.git/commit - src/PeerPoolMgr.cc
Count failures and use peer-specific connect timeouts when tunneling.
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Wed, 12 Apr 2017 23:34:50 +0000 (11:34 +1200)
committerAmos Jeffries <>
Wed, 12 Apr 2017 23:34:50 +0000 (11:34 +1200)
commit0ce8e93bd91ba176e1f27087a9e5ed6481e7d24a
tree1b0f3f6f415fe9f5191709938eb199ef3be1a79b
parent2d51fa427bb22f4f0e1c8a4bda71c37f94c6d236
Count failures and use peer-specific connect timeouts when tunneling.

Fixed two bugs with tunneling CONNECT requests (or equivalent traffic)
through a cache_peer:

1. Not detecting dead cache_peers due to missing code to count peer
   connect failures. TLS/SSL-level failures were detected (for "tls"
   cache_peers) but TCP/IP connect(2) failures were not (for all peers).

2. Origin server connect_timeout used instead of peer_connect_timeout or
   a peer-specific connect-timeout=N (where configured).

The regular forwarding code path does not have the above bugs. This
change reduces code duplication across the two code paths (that
duplication probably caused these bugs in the first place), but a lot
more work is needed in that direction.

The 5-second forwarding timeout hack has been in Squid since
forward_timeout inception (r6733). It is not without problems (now
marked with an XXX), but I left it as is to avoid opening another
Pandora box. The hack now applies to the tunneling code path as well.
12 files changed:
src/CachePeer.h
src/FwdState.cc
src/FwdState.h
src/PeerPoolMgr.cc
src/cache_cf.cc
src/comm/ConnOpener.cc
src/comm/Connection.cc
src/comm/Connection.h
src/neighbors.cc
src/neighbors.h
src/tests/stub_neighbors.cc
src/tunnel.cc