]> git.ipfire.org Git - thirdparty/bind9.git/commit
Make the netmgr read callback to be asynchronous only when needed
authorOndřej Surý <ondrej@isc.org>
Wed, 23 Nov 2022 13:03:23 +0000 (14:03 +0100)
committerOndřej Surý <ondrej@isc.org>
Fri, 25 Nov 2022 14:46:15 +0000 (15:46 +0100)
commit5ca49942a332a7d973ddeede679c9c8155e497cb
tree09bfb7fd6a11917bb1f4f067a8d37b2e61c38928
parentc1305baecedd402cfa0eeb46b78df49f45d7c63a
Make the netmgr read callback to be asynchronous only when needed

Previously, the read callback would be synchronous only on success or
timeout.  Add an option (similar to what other callbacks have) to decide
whether we need the asynchronous read 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 read callback, this means we need the asynchronous path for
failure paths inside the isc_nm_read() (which calls isc__nm_udp_read(),
isc__nm_tcp_read(), etc...) - all other invocations of the read callback
could be synchronous, because those are called from the respective libuv
or netmgr read 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/tlsstream.c
lib/isc/netmgr/udp.c