]> git.ipfire.org Git - thirdparty/bind9.git/commit
Refactor async callbacks and fix the double tlsdnsconnect callback
authorOndřej Surý <ondrej@sury.org>
Tue, 6 Apr 2021 16:27:38 +0000 (18:27 +0200)
committerOndřej Surý <ondrej@sury.org>
Wed, 7 Apr 2021 13:36:59 +0000 (15:36 +0200)
commit72ef5f465d22e7a815288d46196f911770f4e87d
tree66f424ea8f2b0965ffa2d9831214411b8bb37572
parent58e75e3ce5d63890dd08cc8980eb37c5ce8d328f
Refactor async callbacks and fix the double tlsdnsconnect callback

The isc_nm_tlsdnsconnect() call could end up with two connect callbacks
called when the timeout fired and the TCP connection was aborted,
but the TLS handshake was not complete yet.  isc__nm_connecttimeout_cb()
forgot to clean up sock->tls.pending_req when the connect callback was
called with ISC_R_TIMEDOUT, leading to a second callback running later.

A new argument has been added to the isc__nm_*_failed_connect_cb and
isc__nm_*_failed_read_cb functions, to indicate whether the callback
needs to run asynchronously or not.
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
lib/isc/tests/netmgr_test.c