]> git.ipfire.org Git - thirdparty/squid.git/commit - src/comm/Connection.h
Happy Eyeballs: Use each fully resolved forwarding destination ASAP.
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 Jun 2017 04:38:40 +0000 (22:38 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 9 Jun 2017 04:38:40 +0000 (22:38 -0600)
commit6043e368505c7059b5979f6c4de3e4aa68c66231
tree08ec87ed5feb9420f5e4087f3827274752fbf82b
parent03eb3b04f7c79835d82622476573b70f45c6a0d6
Happy Eyeballs: Use each fully resolved forwarding destination ASAP.

Do not wait for all request forwarding destinations to be resolved. Use
each resolved destination as soon as it is needed. This change does not
improve or affect IPv4/IPv6 handling (Squid still waits for both DNS A
and AAAA answers when resolving a single destination name), but the peer
selection code can now deliver each IP address to the FwdState/tunneling
code without waiting for all other destination names to be DNS-resolved.
TODO: Deliver A and AAAA answers to the peer selection code ASAP.

This change speeds up forwarding in peering environments where peers may
need frequent DNS resolutions but that was not the motivation here.

This change is a step towards a more complete Happy Eyeballs support in
Squid. The general path can be roughly summarized as follows:

1. Squid has already supported: Use parallel A and AAAA queries.
2. This change: ASAP delivery of IPs from peer selection to FwdState.
3. The next step: ASAP delivery of IPs from DNS to peer selection.
4. A separate project may add: Use parallel TCP connections.

Also fixed missing cbdataReferenceDone(psstate->callback_data) calls
in three error handling cases. These cases probably leaked memory.
src/FwdState.cc
src/FwdState.h
src/Makefile.am
src/PeerSelectState.h
src/comm/Connection.cc
src/comm/Connection.h
src/neighbors.cc
src/peer_select.cc
src/tests/stub_comm.cc
src/tunnel.cc