]> git.ipfire.org Git - thirdparty/bind9.git/commit
allow tcpdns sockets to self-reference while connected
authorWitold Kręcicki <wpk@isc.org>
Wed, 10 Jun 2020 00:07:16 +0000 (17:07 -0700)
committerOndřej Surý <ondrej@isc.org>
Thu, 1 Oct 2020 14:44:43 +0000 (16:44 +0200)
commit8db2ef9f8eb0192db50303d09e23dce9fca9e799
tree146981ddb06815404422eab263d6eeb4e3a4c03f
parent4209f051e9f332fce54375bac4b6212353857ea5
allow tcpdns sockets to self-reference while connected

A TCPDNS socket creates a handle for each complete DNS message.

Previously, when all the handles were disconnected, the socket
would be closed, but the wrapped TCP socket might still have
more to read.

Now, when a connection is established, the TCPDNS socket creates
a reference to itself by attaching itself to sock->self. This
reference isn't cleared until the connection is closed via
EOF, timeout, or server shutdown. This allows the socket to remain
open even when there are no active handles for it.

(cherry picked from commit cd79b4953800daf87b6bfcea0b6f3ce3bec29988)
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c