From: Ondřej Surý Date: Fri, 19 Mar 2021 14:08:14 +0000 (+0100) Subject: Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket X-Git-Tag: v9.17.12~33^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4e0e9e3c13dfb71e8f977ab6cc123e7ef439740;p=thirdparty%2Fbind9.git Call isc__nm_tlsdns_failed_read on tls_error to cleanup the socket In tls_error(), we now call isc__nm_tlsdns_failed_read() instead of just stopping timer and reading from the socket. This allows us to properly cleanup any pending operation on the socket. --- diff --git a/lib/isc/netmgr/tlsdns.c b/lib/isc/netmgr/tlsdns.c index 330a2ae324e..db75b30d1cc 100644 --- a/lib/isc/netmgr/tlsdns.c +++ b/lib/isc/netmgr/tlsdns.c @@ -1045,8 +1045,7 @@ tls_error(isc_nmsocket_t *sock, isc_result_t result) { switch (sock->tls.state) { case TLS_STATE_HANDSHAKE: case TLS_STATE_IO: - isc__nmsocket_timer_stop(sock); - isc__nm_stop_reading(sock); + isc__nm_tlsdns_failed_read_cb(sock, result); break; case TLS_STATE_ERROR: return; @@ -1769,6 +1768,8 @@ tlsdns_close_direct(isc_nmsocket_t *sock) { REQUIRE(sock->tid == isc_nm_tid()); REQUIRE(atomic_load(&sock->closing)); + REQUIRE(sock->tls.pending_req == NULL); + if (sock->quota != NULL) { isc_quota_detach(&sock->quota); }