mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
[9.20] chg: dev: Shutdown the fetch context after canceling the last fetch
Shutdown the fetch context immediately after the last fetch has been canceled from that particular fetch context. Backport of MR !9958 Merge branch 'backport-ondrej/shutdown-the-fetch-context-early-9.20' into 'bind-9.20' See merge request isc-projects/bind9!9977
This commit is contained in:
commit
55b7cc9596
1 changed files with 9 additions and 4 deletions
|
|
@ -10604,6 +10604,7 @@ fail:
|
|||
void
|
||||
dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
||||
fetchctx_t *fctx = NULL;
|
||||
bool last_fetch = false;
|
||||
|
||||
REQUIRE(DNS_FETCH_VALID(fetch));
|
||||
fctx = fetch->private;
|
||||
|
|
@ -10634,11 +10635,15 @@ dns_resolver_cancelfetch(dns_fetch_t *fetch) {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The fctx continues running even if no fetches remain;
|
||||
* the answer is still cached.
|
||||
*/
|
||||
if (ISC_LIST_EMPTY(fctx->resps)) {
|
||||
last_fetch = true;
|
||||
}
|
||||
UNLOCK(&fctx->lock);
|
||||
|
||||
if (last_fetch) {
|
||||
fetchctx_ref(fctx);
|
||||
isc_async_run(fctx->loop, fctx_shutdown, fctx);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in a new issue