current-queries
Shows the currently active queries.
+clear-cookies [*IP*...]
+ Remove entries from cookie table. If *IP* is ``*``, remove all.
+
clear-dont-throttle-names *NAME* [*NAME*...]
Remove names that are not allowed to be throttled. If *NAME* is ``*``, remove all
static LockGuarded<CookieStore> s_cookiestore;
-void clearCookies()
+uint64_t clearCookies(vector<string>::iterator begin, vector<string>::iterator end)
{
auto lock = s_cookiestore.lock();
- lock->clear();
+ uint64_t count = 0;
+ if (begin == end) {
+ return 0;
+ }
+ if (*begin == "*") {
+ count = lock->size();
+ lock->clear();
+ }
+ else {
+ while (begin != end) {
+ try {
+ count += lock->erase(ComboAddress(*begin, 53));
+ }
+ catch (const PDNSException &) {
+ ;
+ }
+ ++begin;
+ }
+ }
+ return count;
}
void pruneCookies(time_t cutoff)
LWResult::Result asyncresolve(const OptLog& log, const ComboAddress& address, const DNSName& domain, int type, bool doTCP, bool sendRDQuery, int EDNS0Level, struct timeval* now, boost::optional<Netmask>& srcmask, const ResolveContext& context, const std::shared_ptr<std::vector<std::unique_ptr<RemoteLogger>>>& outgoingLoggers, const std::shared_ptr<std::vector<std::unique_ptr<FrameStreamLogger>>>& fstrmLoggers, const std::set<uint16_t>& exportTypes, LWResult* lwr, bool* chained);
uint64_t dumpCookies(int fileDesc);
-void clearCookies();
+uint64_t clearCookies(vector<string>::iterator begin, vector<string>::iterator end);
void pruneCookies(time_t cutoff);
void enableOutgoingCookies(bool flag);
"add-nta DOMAIN [REASON] add a Negative Trust Anchor for DOMAIN with the comment REASON\n"
"add-ta DOMAIN DSRECORD add a Trust Anchor for DOMAIN with data DSRECORD\n"
"current-queries show currently active queries\n"
- // "clear-cookies clear cookie table\n" XXX undocumented for now
+ "clear-cookies [IP...] clear entries from cookie table, if IP is '*' remove all entries\n"
"clear-dont-throttle-names [N...] remove names that are not allowed to be throttled. If N is '*', remove all\n"
"clear-dont-throttle-netmasks [N...]\n"
" remove netmasks that are not allowed to be throttled. If N is '*', remove all\n"
return doDumpCache(socket, begin, end);
}
if (cmd == "clear-cookies") {
- clearCookies();
- return {0, ""};
+ auto count = clearCookies(begin, end);
+ return {0, "Cleared " + std::to_string(count) + " entr" + addS(count, "y", "ies") + " from cookies table\n"};
}
if (cmd == "dump-cookies") {
return doDumpToFile(socket, pleaseDumpCookiesMap, cmd, false);