mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-03 13:59:27 -04:00
Merge branch 'cleanup-socket-references' into 'master'
use isc_refcount_decrement to decrement NEWCONNSOCK(dev)->references; use... See merge request isc-projects/bind9!1821
This commit is contained in:
commit
fd7f2c8f9d
1 changed files with 6 additions and 4 deletions
|
|
@ -2522,7 +2522,7 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
|
|||
abort();
|
||||
}
|
||||
sock->threadid = gen_threadid(sock);
|
||||
isc_refcount_init(&sock->references, 1);
|
||||
isc_refcount_increment(&sock->references);
|
||||
thread = &manager->threads[sock->threadid];
|
||||
*socketp = (isc_socket_t *)sock;
|
||||
|
||||
|
|
@ -3025,7 +3025,7 @@ internal_accept(isc__socket_t *sock) {
|
|||
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]);
|
||||
} else {
|
||||
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]);
|
||||
NEWCONNSOCK(dev)->references--;
|
||||
isc_refcount_decrement(&NEWCONNSOCK(dev)->references);
|
||||
free_socket((isc__socket_t **)&dev->newsocket);
|
||||
}
|
||||
|
||||
|
|
@ -5139,13 +5139,15 @@ isc_socket_cancel(isc_socket_t *sock0, isc_task_t *task, unsigned int how) {
|
|||
ISC_LIST_UNLINK(sock->accept_list, dev,
|
||||
ev_link);
|
||||
|
||||
NEWCONNSOCK(dev)->references--;
|
||||
isc_refcount_decrement(
|
||||
&NEWCONNSOCK(dev)->references);
|
||||
free_socket((isc__socket_t **)&dev->newsocket);
|
||||
|
||||
dev->result = ISC_R_CANCELED;
|
||||
dev->ev_sender = sock;
|
||||
isc_task_sendtoanddetach(¤t_task,
|
||||
ISC_EVENT_PTR(&dev), sock->threadid);
|
||||
ISC_EVENT_PTR(&dev),
|
||||
sock->threadid);
|
||||
}
|
||||
|
||||
dev = next;
|
||||
|
|
|
|||
Loading…
Reference in a new issue