]> git.ipfire.org Git - thirdparty/bind9.git/commit
Make the netmgr send callback to be asynchronous only when needed
authorOndřej Surý <ondrej@isc.org>
Thu, 24 Nov 2022 16:11:22 +0000 (17:11 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 25 Nov 2022 14:46:25 +0000 (15:46 +0100)
commitf3004da3a5ce577c0e794606fd32f1b99d830525
tree023c9816e0ce450f5680a3f906d4fae72d0b9517
parent5ca49942a332a7d973ddeede679c9c8155e497cb
Make the netmgr send callback to be asynchronous only when needed

Previously, the send callback would be synchronous only on success.  Add
an option (similar to what other callbacks have) to decide whether we
need the asynchronous send callback on a higher level.

On a general level, we need the asynchronous callbacks to happen only
when we are invoking the callback from the public API.  If the path to
the callback went through the libuv callback or netmgr callback, we are
already on asynchronous path, and there's no need to make the call to
the callback asynchronous again.

For the send callback, this means we need the asynchronous path for
failure paths inside the isc_nm_send() (which calls isc__nm_udp_send(),
isc__nm_tcp_send(), etc...) - all other invocations of the send callback
could be synchronous, because those are called from the respective libuv
send callbacks.
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tcp.c
lib/isc/netmgr/tcpdns.c
lib/isc/netmgr/tlsdns.c
lib/isc/netmgr/udp.c