return "dumped "+std::to_string(total)+" records\n";
}
-uint64_t* pleaseWipeCache(const DNSName& canon, bool subtree, uint16_t qtype)
-{
- return new uint64_t(g_recCache->doWipeCache(canon, subtree, qtype));
-}
-
uint64_t* pleaseWipePacketCache(const DNSName& canon, bool subtree, uint16_t qtype)
{
return new uint64_t(t_packetCache->doWipePacketCache(canon, qtype, subtree));
}
-
-uint64_t* pleaseWipeAndCountNegCache(const DNSName& canon, bool subtree)
-{
- uint64_t ret = g_negCache->wipe(canon, subtree);
- return new uint64_t(ret);
-}
-
-
template<typename T>
static string doWipeCache(T begin, T end, uint16_t qtype)
{
int count=0, pcount=0, countNeg=0;
for (auto wipe : toWipe) {
try {
- count+= broadcastAccFunction<uint64_t>([=]{ return pleaseWipeCache(wipe.first, wipe.second, qtype);});
- pcount+= broadcastAccFunction<uint64_t>([=]{ return pleaseWipePacketCache(wipe.first, wipe.second, qtype);});
- countNeg+=broadcastAccFunction<uint64_t>([=]{ return pleaseWipeAndCountNegCache(wipe.first, wipe.second);});
+ count += g_recCache->doWipeCache(wipe.first, wipe.second, qtype);
+ pcount += broadcastAccFunction<uint64_t>([=]{ return pleaseWipePacketCache(wipe.first, wipe.second, qtype);});
+ countNeg += g_negCache->wipe(wipe.first, wipe.second);
}
catch (const std::exception& e) {
g_log<<Logger::Warning<<", failed: "<<e.what()<<endl;
lci.negAnchors[who] = why;
});
try {
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeCache(who, true, 0xffff);});
+ g_recCache->doWipeCache(who, true, 0xffff);
broadcastAccFunction<uint64_t>([=]{return pleaseWipePacketCache(who, true, 0xffff);});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeAndCountNegCache(who, true);});
+ g_negCache->wipe(who, true);
}
catch (std::exception& e) {
g_log<<Logger::Warning<<", failed: "<<e.what()<<endl;
g_luaconfs.modify([entry](LuaConfigItems& lci) {
lci.negAnchors.erase(entry);
});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeCache(entry, true, 0xffff);});
+ g_recCache->doWipeCache(entry, true, 0xffff);
broadcastAccFunction<uint64_t>([=]{return pleaseWipePacketCache(entry, true, 0xffff);});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeAndCountNegCache(entry, true);});
+ g_negCache->wipe(entry, true);
if (!first) {
first = false;
removed += ",";
auto ds=std::dynamic_pointer_cast<DSRecordContent>(DSRecordContent::make(what));
lci.dsAnchors[who].insert(*ds);
});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeCache(who, true, 0xffff);});
+ g_recCache->doWipeCache(who, true, 0xffff);
broadcastAccFunction<uint64_t>([=]{return pleaseWipePacketCache(who, true, 0xffff);});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeAndCountNegCache(who, true);});
+ g_negCache->wipe(who, true);
g_log<<Logger::Warning<<endl;
return "Added Trust Anchor for " + who.toStringRootDot() + " with data " + what + "\n";
}
g_luaconfs.modify([entry](LuaConfigItems& lci) {
lci.dsAnchors.erase(entry);
});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeCache(entry, true, 0xffff);});
+ g_recCache->doWipeCache(entry, true, 0xffff);
broadcastAccFunction<uint64_t>([=]{return pleaseWipePacketCache(entry, true, 0xffff);});
- broadcastAccFunction<uint64_t>([=]{return pleaseWipeAndCountNegCache(entry, true);});
+ g_negCache->wipe(entry, true);
if (!first) {
first = false;
removed += ",";