]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdns: dnsseckeeper - Clarify cache clearing never fails
authorAki Tuomi <cmouse@cmouse.fi>
Fri, 30 Oct 2020 19:47:22 +0000 (21:47 +0200)
committerAki Tuomi <cmouse@cmouse.fi>
Fri, 17 Sep 2021 07:22:00 +0000 (10:22 +0300)
pdns/dbdnsseckeeper.cc

index 650580a53ee639910a35744d45016a368d7fd851..a318a36adae3fbca54227392458ac2181338e0c6 100644 (file)
@@ -127,7 +127,8 @@ void DNSSECKeeper::clearAllCaches() {
   s_metacache.clear();
 }
 
-
+/* This function never fails, the return value is to simplify call chains
+   elsewhere so we can do mutate<cache> && clear<cache> */
 bool DNSSECKeeper::clearKeyCache(const DNSName& name)
 {
   WriteLock l(&s_keycachelock);
@@ -145,8 +146,8 @@ bool DNSSECKeeper::clearMetaCache(const DNSName& name)
 
 void DNSSECKeeper::clearCaches(const DNSName& name)
 {
-  clearKeyCache(name);
-  clearMetaCache(name);
+  (void)clearKeyCache(name);
+  (void)clearMetaCache(name);
 }
 
 bool DNSSECKeeper::addKey(const DNSName& name, const DNSSECPrivateKey& dpk, int64_t& id, bool active, bool published)