]> git.ipfire.org Git - thirdparty/bind9.git/commit
TLSDNS: call send callbacks after only the data was sent
authorArtem Boldariev <artem@boldariev.com>
Wed, 13 Apr 2022 13:24:20 +0000 (16:24 +0300)
committerArtem Boldariev <artem@boldariev.com>
Wed, 27 Apr 2022 14:44:23 +0000 (17:44 +0300)
commit978f97dcdddb8a6ee447e40b3d9be7f7cf92c0c2
treeaf365616f743e3dd1c043376e557ee449dfba39b
parentf83f8b065b8f93dd8997ccf9630514e5fcc5f50c
TLSDNS: call send callbacks after only the data was sent

This commit ensures that write callbacks are getting called only after
the data has been sent via the network.

Without this fix, a situation could appear when a write callback could
get called before the actual encrypted data would have been sent to
the network. Instead, it would get called right after it would have
been passed to the OpenSSL (i.e. encrypted).

Most likely, the issue does not reveal itself often because the
callback call was asynchronous, so in most cases it should have been
called after the data has been sent, but that was not guaranteed by
the code logic.

Also, this commit removes one memory allocation (netievent) from a hot
path, as there is no need to call this callback asynchronously
anymore.
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c
lib/isc/netmgr/tlsdns.c