#include "recpacketcache.hh"
#include "cachecleaner.hh"
#include "dns.hh"
-#include "dnsparser.hh"
#include "namespaces.hh"
-#include "lock.hh"
-#include "dnswriter.hh"
-#include "ednsoptions.hh"
RecursorPacketCache::RecursorPacketCache()
{
}
if(iter == range.second) { // nothing to refresh
- struct Entry e;
- e.d_packet = responsePacket;
- e.d_name = qname;
+ struct Entry e(qname, responsePacket);
e.d_qhash = qhash;
e.d_type = qtype;
e.d_class = qclass;
#ifndef PDNS_RECPACKETCACHE_HH
#define PDNS_RECPACKETCACHE_HH
#include <string>
-#include <set>
#include <inttypes.h>
#include "dns.hh"
#include "namespaces.hh"
struct NameTag {};
struct Entry
{
+ Entry(const DNSName& qname, const std::string& packet): d_name(qname), d_packet(packet)
+ {
+ }
+
mutable time_t d_ttd;
mutable time_t d_creation; // so we can 'age' our packets
DNSName d_name;
uint32_t d_qhash;
uint32_t d_tag;
inline bool operator<(const struct Entry& rhs) const;
-
+
time_t getTTD() const
{
return d_ttd;