2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Only start stale refresh window when resuming

If we did not attempt a fetch due to fetch-limits, we should not start
the stale-refresh-time window.

Introduce a new flag DNS_DBFIND_STALESTART to differentiate between
a resolver failure and unexpected error. If we are resuming, this
indicates a resolver failure, then start the stale-refresh-time window,
otherwise don't start the stale-refresh-time window, but still fall
back to using stale data.

(This commit also wraps some docstrings to 80 characters width)
This commit is contained in:
Matthijs Mekking
2021-01-27 16:59:27 +01:00
parent c6fd02aed5
commit aabdedeae3
3 changed files with 33 additions and 21 deletions

View File

@@ -7560,7 +7560,15 @@ query_gotanswer(query_ctx_t *qctx, isc_result_t res) {
/*
* If serve-stale is enabled, query_usestale() already
* set up 'qctx' for looking up a stale response.
*
* We only need to check if the query timed out or
* something else has gone wrong. If the query timed
* out, we will start the stale-refresh-time window.
*/
if (qctx->resuming && result == ISC_R_TIMEDOUT) {
qctx->client->query.dboptions |=
DNS_DBFIND_STALESTART;
}
return (query_lookup(qctx));
}