mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
Clone the csock in accept_connection(), not in callback
If we clone the csock (children socket) in TCP accept_connection() instead of passing the ssock (server socket) to the call back and cloning it there we unbreak the assumption that every socket is handled inside it's own worker thread and therefore we can get rid of (at least) callback locking.
This commit is contained in:
@@ -379,12 +379,7 @@ udp_recv_cb(uv_udp_t *handle, ssize_t nrecv, const uv_buf_t *buf,
|
||||
region.base = (unsigned char *)buf->base;
|
||||
region.length = nrecv;
|
||||
|
||||
/*
|
||||
* In tcp.c and tcpdns.c, this would need to be locked
|
||||
* by sock->lock because callbacks may be set to NULL
|
||||
* unexpectedly when the connection drops, but that isn't
|
||||
* a factor in the UDP case.
|
||||
*/
|
||||
INSIST(sock->tid == isc_nm_tid());
|
||||
INSIST(sock->recv_cb != NULL);
|
||||
cb = sock->recv_cb;
|
||||
cbarg = sock->recv_cbarg;
|
||||
|
Reference in New Issue
Block a user