From: Artem Boldariev Date: Tue, 10 May 2022 20:09:59 +0000 (+0300) Subject: Dig: Do not call isc_nm_cancelread() for HTTP sockets X-Git-Tag: v9.19.2~22^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90c52ca12b24345d22739c1277ab28170811deb8;p=thirdparty%2Fbind9.git Dig: Do not call isc_nm_cancelread() for HTTP sockets This commit ensures that isc_nm_cancelread() is not called from within dig code for HTTP sockets, as these lack its implementation. It does not have much sense to have it due to transactional nature of HTTP. Every HTTP request-response pair is represented by a virtual socket, where read callback is called only when full DNS message is received or when an error code is being passed there. That is, there is nothing to cancel at the time of the call. --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 14f62678594..e29f9514651 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -2752,7 +2752,8 @@ _cancel_lookup(dig_lookup_t *lookup, const char *file, unsigned int line) { debug("canceling pending query %p, belonging to %p", query, query->lookup); query->canceled = true; - if (query->readhandle != NULL) { + if (query->readhandle != NULL && + !isc_nm_is_http_handle(query->readhandle)) { isc_nm_cancelread(query->readhandle); } query_detach(&query); @@ -4566,7 +4567,8 @@ cancel_all(void) { debug("canceling pending query %p, belonging to %p", q, current_lookup); q->canceled = true; - if (q->readhandle != NULL) { + if (q->readhandle != NULL && + !isc_nm_is_http_handle(q->readhandle)) { isc_nm_cancelread(q->readhandle); } query_detach(&q);