]> git.ipfire.org Git - thirdparty/bind9.git/commit
Enable requesting TCP connections to be closed
authorMichał Kępień <michal@isc.org>
Tue, 15 Jul 2025 10:16:32 +0000 (12:16 +0200)
committerŠtěpán Balážik <stepan@isc.org>
Thu, 24 Jul 2025 11:09:49 +0000 (13:09 +0200)
commit06b0800df88d3575efff64f30104db3a053fb02c
tree7fe9e94f388caacbf448218876dbf6b66941b8ee
parent30753f77236c73258c69a17d016a9649ae2b2c6a
Enable requesting TCP connections to be closed

In response to client queries, AsyncDnsServer users can currently only
make the server either send a reply or silently ignore the query.  In
the case of TCP queries, neither of these actions causes the client's
connection to be closed - the onus of doing that is on the client.
However, in some cases the server may be required to close the
connection on its own, so AsyncDnsServer users need to have some way of
requesting such an action.

Add a new ResponseAction subclass, ResponseDropAndCloseConnection, which
enables AsyncDnsServer users to conveniently request TCP connections to
be closed.  Instead of returning the response to send,
ResponseDropAndCloseConnection raises a custom exception that
AsyncDnsServer._handle_tcp() handles accordingly.
bin/tests/system/isctest/asyncserver.py