inc_stats(client, counter);
ns_client_send(client);
- if (!QUERY_STALEONLY(&client->query)) {
+ if (!client->nodetach) {
isc_nmhandle_detach(&client->reqhandle);
}
}
ns_client_error(client, result);
- if (!QUERY_STALEONLY(&client->query)) {
+ if (!client->nodetach) {
isc_nmhandle_detach(&client->reqhandle);
}
}
}
ns_client_drop(client, result);
- if (!QUERY_STALEONLY(&client->query)) {
+ if (!client->nodetach) {
isc_nmhandle_detach(&client->reqhandle);
}
}
dns_db_detach(&qctx->zdb);
}
- if (qctx->event != NULL && !QUERY_STALEONLY(&qctx->client->query)) {
+ if (qctx->event != NULL && !qctx->client->nodetach) {
free_devent(qctx->client, ISC_EVENT_PTR(&qctx->event),
&qctx->event);
}
* active RRset is not available.
*/
qctx->client->query.dboptions |= DNS_DBFIND_STALEONLY;
+ qctx->client->nodetach = true;
}
dboptions = qctx->client->query.dboptions;
&qctx->db);
qctx->client->query.dboptions &=
~DNS_DBFIND_STALEONLY;
+ qctx->client->nodetach = false;
qctx->options &= ~DNS_GETDB_STALEFIRST;
if (qctx->client->query.fetch != NULL) {
dns_resolver_destroyfetch(
* actually not a 'stale-only' lookup. Clear the flag to
* allow the client to be detach the handle.
*/
- qctx->client->query.dboptions &= ~DNS_DBFIND_STALEONLY;
+ qctx->client->nodetach = false;
}
result = query_gotanswer(qctx, result);
dns_db_attach(client->view->cachedb, &qctx.db);
client->query.attributes &= ~NS_QUERYATTR_RECURSIONOK;
client->query.dboptions |= DNS_DBFIND_STALEONLY;
+ client->nodetach = true;
(void)query_lookup(&qctx);
if (qctx.node != NULL) {
dns_db_detachnode(qctx.db, &qctx.node);
query_lookup_staleonly(client);
isc_event_free(ISC_EVENT_PTR(&event));
return;
- } else {
- client->query.dboptions &= ~DNS_DBFIND_STALEONLY;
}
+ client->query.dboptions &= ~DNS_DBFIND_STALEONLY;
+ client->nodetach = false;
+
LOCK(&client->query.fetchlock);
if (client->query.fetch != NULL) {
/*
ns_query_done(query_ctx_t *qctx) {
isc_result_t result = ISC_R_UNSET;
const dns_namelist_t *secs = qctx->client->message->sections;
- bool query_stale_only;
+ bool nodetach;
CCTRACE(ISC_LOG_DEBUG(3), "ns_query_done");
* Client may have been detached after query_send(), so
* we test and store the flag state here, for safety.
*/
- query_stale_only = QUERY_STALEONLY(&qctx->client->query);
+ nodetach = qctx->client->nodetach;
query_send(qctx->client);
-
- if (!query_stale_only) {
+ if (!nodetach) {
qctx->detach_client = true;
}
return (qctx->result);