Shutdown all active TCP connections on error
requested to merge 3026-premature-tcp-connection-closure-leaks-fetch-contexts-hang-on-shutdown into main
When outgoing TCP connection was prematurely terminated (f.e. with connection reset), the dispatch code would not cleanup the resources used by such connection leading to dangling dns_dispentry_t entries.
This branch introduces refactored tcp_recv() code that cleanly shuts down the TCP and cleans up resources on any failure, now also including the cases when the server sends the client garbage DNS message, DNS query or non-matching DNS answer.
Closes #3026 (closed)
Edited by Ondřej Surý