Skip to content

Commit

Permalink
auth api: flush all caches when flushing
Browse files Browse the repository at this point in the history
So far we never flushed the DNSSEC caches, except when DELETEing a domain.
However clearly some operations can affect the DNSSEC settings, and then the
caches should go.

Also do this for the flush API, to be consistent, and for users writing to the
DNSSEC settings/data externally.
  • Loading branch information
zeha committed Dec 15, 2023
1 parent 1d4a889 commit cbc5c67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pdns/ws-auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2331,6 +2331,7 @@ static void patchZone(UeberBackend& B, const DNSName& zonename, DomainInfo& di,

di.backend->commitTransaction();

DNSSECKeeper::clearCaches(zonename);
purgeAuthCaches(zonename.toString() + "$");

resp->body = "";
Expand Down Expand Up @@ -2459,6 +2460,7 @@ static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {
}
}

DNSSECKeeper::clearCaches(canon);
// purge entire zone from cache, not just zone-level records.
uint64_t count = purgeAuthCaches(canon.toString() + "$");
resp->setJsonBody(Json::object {
Expand Down

0 comments on commit cbc5c67

Please sign in to comment.