dnsdist: Refactoring of the TCP stack #7559
This PR completely changes the way dnsdist handles TCP connections, moving to an event-based mode that allows a single thread to handle a large number of connections, instead of only one. It makes DNS over TCP and DNS over TLS much more scalable.
IMHO merging this PR calls for the move to the 1.4.x branch at least, perhaps 2.0.x.
This way the rest of the code can mostly ignore whether DNSCrypt support is enabled.
The new implementation does not try to be too smart about that anymore.
We need to because the TLS layer might already have data waiting for us, while there might not be anything left on the OS-level buffer associated to the socket. If we don't ask the TLS layer, we might wait indefinitely for something to arrive while the client has already sent everything, and it's just waiting for us because the TLS record has been read.
Instead of waiting for the socket to be readable, as it might already be, so we save a multiplexer trip, and prevent an issue if we ever add a TLS layer between dnsdist and the backends.