From 670df3da74c9da75238298ef35a528c6d0e30873 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Fri, 24 Mar 2023 12:20:07 +0100 Subject: [PATCH] Re-add the comment to streamdns_readmore() Put the comment back, so it's more obvious that we are only restarting timer when there's a last handle attached to the socket; there has to be always at least one. --- lib/isc/netmgr/streamdns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/isc/netmgr/streamdns.c b/lib/isc/netmgr/streamdns.c index 2b3c8c38b9..a34e46d3e6 100644 --- a/lib/isc/netmgr/streamdns.c +++ b/lib/isc/netmgr/streamdns.c @@ -103,8 +103,10 @@ static void streamdns_readmore(isc_nmsocket_t *sock, isc_nmhandle_t *transphandle) { streamdns_resumeread(sock, transphandle); + /* Restart the timer only if there's a last single active handle */ isc_nmhandle_t *handle = ISC_LIST_HEAD(sock->active_handles); - if (handle != NULL && ISC_LIST_NEXT(handle, active_link) == NULL) { + INSIST(handle != NULL); + if (ISC_LIST_NEXT(handle, active_link) == NULL) { isc__nmsocket_timer_start(sock); } }