mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Proper accounting of active TCP connections
This commit is contained in:
committed by
Witold Krecicki
parent
71b05e3e0f
commit
fc9e2276ca
@@ -718,6 +718,9 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree) {
|
||||
for (int i = 0; i < sock->nchildren; i++) {
|
||||
if (!atomic_load(&sock->children[i].destroying)) {
|
||||
nmsocket_cleanup(&sock->children[i], false);
|
||||
if (sock->statsindex != NULL) {
|
||||
isc__nm_decstats(sock->mgr, sock->statsindex[STATID_ACTIVE]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -729,6 +732,9 @@ nmsocket_cleanup(isc_nmsocket_t *sock, bool dofree) {
|
||||
sock->children = NULL;
|
||||
sock->nchildren = 0;
|
||||
}
|
||||
if (sock->statsindex != NULL) {
|
||||
isc__nm_decstats(sock->mgr, sock->statsindex[STATID_ACTIVE]);
|
||||
}
|
||||
|
||||
if (sock->tcphandle != NULL) {
|
||||
isc_nmhandle_unref(sock->tcphandle);
|
||||
@@ -843,8 +849,6 @@ isc__nmsocket_prep_destroy(isc_nmsocket_t *sock) {
|
||||
if (sock->children != NULL) {
|
||||
for (int i = 0; i < sock->nchildren; i++) {
|
||||
atomic_store(&sock->children[i].active, false);
|
||||
isc__nm_decstats(sock->mgr,
|
||||
sock->statsindex[STATID_ACTIVE]);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user