Remove the 'want_stale' field from struct query_ctx

As the previous commit makes the 'want_stale' field of struct query_ctx
redundant, remove it.
This commit is contained in:
Michał Kępień 2018-10-08 12:47:28 +02:00
parent cb48d410d8
commit b3cd868c4b
2 changed files with 10 additions and 14 deletions

View file

@ -130,19 +130,18 @@ typedef struct query_ctx {
unsigned int options; /* DB lookup options */
bool redirected; /* nxdomain redirected? */
bool is_zone; /* is DB a zone DB? */
bool redirected; /* nxdomain redirected? */
bool is_zone; /* is DB a zone DB? */
bool is_staticstub_zone;
bool resuming; /* resumed from recursion? */
bool resuming; /* resumed from recursion? */
bool dns64, dns64_exclude, rpz;
bool authoritative; /* authoritative query? */
bool want_restart; /* CNAME chain or other
bool authoritative; /* authoritative query? */
bool want_restart; /* CNAME chain or other
* restart needed */
bool need_wildcardproof; /* wilcard proof needed */
bool nxrewrite; /* negative answer from RPZ */
bool findcoveringnsec; /* lookup covering NSEC */
bool want_stale; /* want stale records? */
bool answer_has_ns; /* NS is in answer */
bool need_wildcardproof; /* wilcard proof needed */
bool nxrewrite; /* negative answer from RPZ */
bool findcoveringnsec; /* lookup covering NSEC */
bool answer_has_ns; /* NS is in answer */
dns_fixedname_t wildcardname; /* name needing wcard proof */
dns_fixedname_t dsname; /* name needing DS */

View file

@ -5034,7 +5034,6 @@ qctx_init(ns_client_t *client, dns_fetchevent_t *event,
qctx->findcoveringnsec = client->view->synthfromdnssec;
qctx->is_staticstub_zone = false;
qctx->nxrewrite = false;
qctx->want_stale = false;
qctx->answer_has_ns = false;
qctx->authoritative = false;
}
@ -5524,12 +5523,11 @@ query_lookup(query_ctx_t *qctx) {
dns_cache_updatestats(qctx->client->view->cache, result);
}
if (qctx->want_stale) {
if ((qctx->client->query.dboptions & DNS_DBFIND_STALEOK) != 0) {
char namebuf[DNS_NAME_FORMATSIZE];
bool success;
qctx->client->query.dboptions &= ~DNS_DBFIND_STALEOK;
qctx->want_stale = false;
if (dns_rdataset_isassociated(qctx->rdataset) &&
dns_rdataset_count(qctx->rdataset) > 0 &&
STALE(qctx->rdataset)) {
@ -6654,7 +6652,6 @@ query_usestale(query_ctx_t *qctx) {
}
if (staleanswersok) {
qctx->want_stale = true;
qctx->client->query.dboptions |= DNS_DBFIND_STALEOK;
inc_stats(qctx->client, ns_statscounter_trystale);
if (qctx->client->query.fetch != NULL) {