2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 23:25:38 +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 * We have a packet: stop timeout timers
*/ */
atomic_store(&dnssock->outer->processing, true); atomic_store(&dnssock->outer->processing, true);
if (dnssock->timer_initialized) {
uv_timer_stop(&dnssock->timer); uv_timer_stop(&dnssock->timer);
}
if (atomic_load(&dnssock->sequential)) { if (atomic_load(&dnssock->sequential)) {
/* /*
@@ -387,9 +389,11 @@ resume_processing(void *arg) {
if (atomic_load(&sock->ah) == 0) { if (atomic_load(&sock->ah) == 0) {
/* Nothing is active; sockets can timeout now */ /* Nothing is active; sockets can timeout now */
atomic_store(&sock->outer->processing, false); atomic_store(&sock->outer->processing, false);
if (sock->timer_initialized) {
uv_timer_start(&sock->timer, dnstcp_readtimeout, uv_timer_start(&sock->timer, dnstcp_readtimeout,
sock->read_timeout, 0); sock->read_timeout, 0);
} }
}
/* /*
* For sequential sockets: Process what's in the buffer, or * For sequential sockets: Process what's in the buffer, or
@@ -401,7 +405,9 @@ resume_processing(void *arg) {
result = processbuffer(sock, &handle); result = processbuffer(sock, &handle);
if (result == ISC_R_SUCCESS) { if (result == ISC_R_SUCCESS) {
atomic_store(&sock->outer->processing, true); atomic_store(&sock->outer->processing, true);
if (sock->timer_initialized) {
uv_timer_stop(&sock->timer); uv_timer_stop(&sock->timer);
}
isc_nmhandle_unref(handle); isc_nmhandle_unref(handle);
} else if (sock->outer != NULL) { } else if (sock->outer != NULL) {
isc_nm_resumeread(sock->outer); isc_nm_resumeread(sock->outer);
@@ -429,7 +435,9 @@ resume_processing(void *arg) {
break; break;
} }
if (sock->timer_initialized) {
uv_timer_stop(&sock->timer); uv_timer_stop(&sock->timer);
}
atomic_store(&sock->outer->processing, true); atomic_store(&sock->outer->processing, true);
isc_nmhandle_unref(dnshandle); isc_nmhandle_unref(dnshandle);
} while (atomic_load(&sock->ah) < TCPDNS_CLIENTS_PER_CONN); } while (atomic_load(&sock->ah) < TCPDNS_CLIENTS_PER_CONN);