mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
use isc_refcount_decrement to decrement NEWCONNSOCK(dev)->references; use isc_refcount_increment instead of isc_refcount_init in socket_create
This commit is contained in:
@@ -2522,7 +2522,7 @@ socket_create(isc_socketmgr_t *manager0, int pf, isc_sockettype_t type,
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
sock->threadid = gen_threadid(sock);
|
sock->threadid = gen_threadid(sock);
|
||||||
isc_refcount_init(&sock->references, 1);
|
isc_refcount_increment(&sock->references);
|
||||||
thread = &manager->threads[sock->threadid];
|
thread = &manager->threads[sock->threadid];
|
||||||
*socketp = (isc_socket_t *)sock;
|
*socketp = (isc_socket_t *)sock;
|
||||||
|
|
||||||
@@ -3025,7 +3025,7 @@ internal_accept(isc__socket_t *sock) {
|
|||||||
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]);
|
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPT]);
|
||||||
} else {
|
} else {
|
||||||
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]);
|
inc_stats(manager->stats, sock->statsindex[STATID_ACCEPTFAIL]);
|
||||||
NEWCONNSOCK(dev)->references--;
|
isc_refcount_decrement(&NEWCONNSOCK(dev)->references);
|
||||||
free_socket((isc__socket_t **)&dev->newsocket);
|
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,
|
ISC_LIST_UNLINK(sock->accept_list, dev,
|
||||||
ev_link);
|
ev_link);
|
||||||
|
|
||||||
NEWCONNSOCK(dev)->references--;
|
isc_refcount_decrement(
|
||||||
|
&NEWCONNSOCK(dev)->references);
|
||||||
free_socket((isc__socket_t **)&dev->newsocket);
|
free_socket((isc__socket_t **)&dev->newsocket);
|
||||||
|
|
||||||
dev->result = ISC_R_CANCELED;
|
dev->result = ISC_R_CANCELED;
|
||||||
dev->ev_sender = sock;
|
dev->ev_sender = sock;
|
||||||
isc_task_sendtoanddetach(¤t_task,
|
isc_task_sendtoanddetach(¤t_task,
|
||||||
ISC_EVENT_PTR(&dev), sock->threadid);
|
ISC_EVENT_PTR(&dev),
|
||||||
|
sock->threadid);
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = next;
|
dev = next;
|
||||||
|
Reference in New Issue
Block a user