2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Fix a race in tcpdns close with uv_close on timer

stop timers before closing

netmgr: tcpdns_close needs to be asynchronous, it manipulates sock->timer
This commit is contained in:
Witold Kręcicki
2019-12-06 22:25:52 +01:00
parent 23ab349bbd
commit 3e66b7ba1c
4 changed files with 60 additions and 26 deletions

View File

@@ -1003,8 +1003,9 @@ tcp_close_direct(isc_nmsocket_t *sock) {
}
}
if (sock->timer_initialized) {
uv_close((uv_handle_t *)&sock->timer, timer_close_cb);
sock->timer_initialized = false;
uv_timer_stop(&sock->timer);
uv_close((uv_handle_t *)&sock->timer, timer_close_cb);
} else {
isc_nmsocket_detach(&sock->server);
uv_close(&sock->uv_handle.handle, tcp_close_cb);