t_RC->doPrune(); // this function is local to a thread, so fine anyhow
t_packetCache->doPruneTo(::arg().asNum("max-packetcache-entries") / g_numThreads);
- {
- typedef SyncRes::negcache_t::nth_index<1>::type negcache_by_ttd_index_t;
- negcache_by_ttd_index_t& ttdindex=boost::multi_index::get<1>(t_sstorage->negcache);
- negcache_by_ttd_index_t::iterator i=ttdindex.lower_bound(now.tv_sec);
- ttdindex.erase(ttdindex.begin(), i);
- }
+ pruneCollection(t_sstorage->negcache, ::arg().asNum("max-cache-entries") / (g_numThreads * 5));
if(!((cleanCounter++)%40)) { // this is a full scan!
time_t limit=now.tv_sec-300;
QType d_qtype;
string d_qname;
uint32_t d_ttd;
+ uint32_t getTTD() const
+ {
+ return d_ttd;
+ }
};
d_doEDNS0=state;
}
-
-
int asyncresolveWrapper(const ComboAddress& ip, const string& domain, int type, bool doTCP, bool sendRDQuery, struct timeval* now, LWResult* res);
static void doEDNSDumpAndClose(int fd);
>,
composite_key_compare<CIStringCompare, std::less<QType> >
>,
- ordered_non_unique<
- member<NegCacheEntry, uint32_t, &NegCacheEntry::d_ttd>
- >
+ sequenced<>
>
> negcache_t;