From 9e38d0e3afbfaf31748c45f7e4fa462b807eaffb Mon Sep 17 00:00:00 2001 From: Aram Sargsyan Date: Mon, 19 Feb 2024 16:15:07 +0000 Subject: [PATCH] Clean up fetch_answered After the changes in [GL #4447] the 'fetch_answered' variable is always false now. Delete the unnecessary code. --- lib/ns/query.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/ns/query.c b/lib/ns/query.c index 4bc57e04c0..efe33a9dd9 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -6217,7 +6217,6 @@ fetch_callback(void *arg) { ns_client_t *client = resp->arg; dns_fetch_t *fetch = NULL; bool fetch_canceled = false; - bool fetch_answered = false; isc_logcategory_t *logcategory = NS_LOGCATEGORY_QUERY_ERRORS; isc_result_t result; int errorloglevel; @@ -6288,7 +6287,7 @@ fetch_callback(void *arg) { */ qctx_init(client, &resp, 0, &qctx); - if (fetch_canceled || fetch_answered) { + if (fetch_canceled) { /* * We've timed out or are shutting down. We can now * free the event and other resources held by qctx, but @@ -6298,14 +6297,10 @@ fetch_callback(void *arg) { qctx_freedata(&qctx); /* - * Return an error to the client, or just drop. + * Return an error to the client. */ - if (fetch_canceled) { - CTRACE(ISC_LOG_ERROR, "fetch cancelled"); - query_error(client, DNS_R_SERVFAIL, __LINE__); - } else { - query_next(client, ISC_R_CANCELED); - } + CTRACE(ISC_LOG_ERROR, "fetch cancelled"); + query_error(client, DNS_R_SERVFAIL, __LINE__); /* * Free any persistent plugin data that was allocated to