Permalink
Browse files

api: use uncached results for getKeys()

  • Loading branch information...
1 parent c574336 commit 8f35ba264a06cd4e5b4124a6e71511c5b1fa1dd6 @mind04 mind04 committed with mind04 Nov 25, 2014
Showing with 4 additions and 4 deletions.
  1. +2 −2 pdns/dbdnsseckeeper.cc
  2. +1 −1 pdns/dnsseckeeper.hh
  3. +1 −1 pdns/ws-auth.cc
@@ -294,15 +294,15 @@ bool DNSSECKeeper::unsetPresigned(const std::string& zname)
}
-DNSSECKeeper::keyset_t DNSSECKeeper::getKeys(const std::string& zone, boost::tribool allOrKeyOrZone)
+DNSSECKeeper::keyset_t DNSSECKeeper::getKeys(const std::string& zone, boost::tribool allOrKeyOrZone, bool useCache)
{
unsigned int now = time(0);
if(!((++s_ops) % 100000)) {
cleanup();
}
- {
+ if (useCache) {
ReadLock l(&s_keycachelock);
keycache_t::const_iterator iter = s_keycache.find(zone);
@@ -71,7 +71,7 @@ public:
}
bool isSecuredZone(const std::string& zone);
- keyset_t getKeys(const std::string& zone, boost::tribool allOrKeyOrZone = boost::indeterminate);
+ keyset_t getKeys(const std::string& zone, boost::tribool allOrKeyOrZone = boost::indeterminate, bool useCache = true);
DNSSECPrivateKey getKeyById(const std::string& zone, unsigned int id);
bool addKey(const std::string& zname, bool keyOrZone, int algorithm=5, int bits=0, bool active=true);
bool addKey(const std::string& zname, const DNSSECPrivateKey& dpk, bool active=true);
View
@@ -492,7 +492,7 @@ static void apiZoneCryptokeys(HttpRequest* req, HttpResponse* resp) {
if(!dk.isSecuredZone(zonename))
throw ApiException("Zone '"+zonename+"' is not secured");
- DNSSECKeeper::keyset_t keyset=dk.getKeys(zonename);
+ DNSSECKeeper::keyset_t keyset=dk.getKeys(zonename, boost::indeterminate, false);
if (keyset.empty())
throw ApiException("No keys for zone '"+zonename+"'");

0 comments on commit 8f35ba2

Please sign in to comment.