2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Only use tcpdns timer if it's initialized.

This commit is contained in:
Witold Kręcicki
2020-03-05 22:56:31 +01:00
parent a249bb5b10
commit 4b9962d4a3

View File

@@ -245,7 +245,9 @@ dnslisten_readcb(isc_nmhandle_t *handle, isc_region_t *region, void *arg) {
* We have a packet: stop timeout timers
*/
atomic_store(&dnssock->outer->processing, true);
uv_timer_stop(&dnssock->timer);
if (dnssock->timer_initialized) {
uv_timer_stop(&dnssock->timer);
}
if (atomic_load(&dnssock->sequential)) {
/*
@@ -387,8 +389,10 @@ resume_processing(void *arg) {
if (atomic_load(&sock->ah) == 0) {
/* Nothing is active; sockets can timeout now */
atomic_store(&sock->outer->processing, false);
uv_timer_start(&sock->timer, dnstcp_readtimeout,
sock->read_timeout, 0);
if (sock->timer_initialized) {
uv_timer_start(&sock->timer, dnstcp_readtimeout,
sock->read_timeout, 0);
}
}
/*
@@ -401,7 +405,9 @@ resume_processing(void *arg) {
result = processbuffer(sock, &handle);
if (result == ISC_R_SUCCESS) {
atomic_store(&sock->outer->processing, true);
uv_timer_stop(&sock->timer);
if (sock->timer_initialized) {
uv_timer_stop(&sock->timer);
}
isc_nmhandle_unref(handle);
} else if (sock->outer != NULL) {
isc_nm_resumeread(sock->outer);
@@ -429,7 +435,9 @@ resume_processing(void *arg) {
break;
}
uv_timer_stop(&sock->timer);
if (sock->timer_initialized) {
uv_timer_stop(&sock->timer);
}
atomic_store(&sock->outer->processing, true);
isc_nmhandle_unref(dnshandle);
} while (atomic_load(&sock->ah) < TCPDNS_CLIENTS_PER_CONN);