mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-28 17:46:40 -04:00
Explicitly stop reading before closing the nmtcpsocket
When closing the socket that is actively reading from the stream, the
read_cb() could be called between uv_close() and close callback when the
server socket has been already detached hence using sock->statichandle
after it has been already freed.
(cherry picked from commit 97b33e5bde)
This commit is contained in:
parent
63e923364f
commit
e18f3fd003
1 changed files with 3 additions and 0 deletions
|
|
@ -1115,6 +1115,9 @@ tcp_close_direct(isc_nmsocket_t *sock) {
|
|||
if (sock->quota != NULL) {
|
||||
isc_quota_detach(&sock->quota);
|
||||
}
|
||||
|
||||
uv_read_stop((uv_stream_t *)&sock->uv_handle.handle);
|
||||
|
||||
if (sock->timer_initialized) {
|
||||
sock->timer_initialized = false;
|
||||
uv_timer_stop(&sock->timer);
|
||||
|
|
|
|||
Loading…
Reference in a new issue