Improving TCP/TLS timer logic for long-lived connections
I am testing long-lived client connections to Knot resolver over TCP or TLS.
Currently, the idle timeout is quite short:
kresd closes a client TCP connection after just a few seconds when no request is made. While investigating this part of the code, I found that the idle timeout strategy is quite complex, and mixes up the timeout values for "downstream" TCP connections and "upstream" TCP connections (while in reality, they have very different requirements).
Below is an attempt at documenting the current behaviour, so that we can discuss how to improve it.