From: Remi Gacogne Date: Fri, 6 Apr 2018 14:01:57 +0000 (+0200) Subject: rec: Pass a ref to an optional pb message for pkt cache insertion X-Git-Tag: dnsdist-1.3.1~172^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c5c05077e9010142258f9f8db21e99786ad00774;p=pdns rec: Pass a ref to an optional pb message for pkt cache insertion --- diff --git a/pdns/recpacketcache.cc b/pdns/recpacketcache.cc index f895c2222..354c3d47a 100644 --- a/pdns/recpacketcache.cc +++ b/pdns/recpacketcache.cc @@ -143,10 +143,11 @@ bool RecursorPacketCache::getResponsePacket(unsigned int tag, const std::string& void RecursorPacketCache::insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl) { - insertResponsePacket(tag, qhash, qname, qtype, qclass, responsePacket, now, ttl, boost::none); + boost::optional pb(boost::none); + insertResponsePacket(tag, qhash, qname, qtype, qclass, responsePacket, now, ttl, pb); } -void RecursorPacketCache::insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl, boost::optional protobufMessage) +void RecursorPacketCache::insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl, const boost::optional& protobufMessage) { auto& idx = d_packetCache.get(); auto range = idx.equal_range(tie(tag,qhash)); diff --git a/pdns/recpacketcache.hh b/pdns/recpacketcache.hh index 9b2ac0e71..40c94e94f 100644 --- a/pdns/recpacketcache.hh +++ b/pdns/recpacketcache.hh @@ -57,7 +57,7 @@ public: bool getResponsePacket(unsigned int tag, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass, time_t now, std::string* responsePacket, uint32_t* age, uint32_t* qhash); bool getResponsePacket(unsigned int tag, const std::string& queryPacket, const DNSName& qname, uint16_t qtype, uint16_t qclass, time_t now, std::string* responsePacket, uint32_t* age, uint32_t* qhash, RecProtoBufMessage* protobufMessage); void insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl); - void insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl, boost::optional protobufMessage); + void insertResponsePacket(unsigned int tag, uint32_t qhash, const DNSName& qname, uint16_t qtype, uint16_t qclass, const std::string& responsePacket, time_t now, uint32_t ttl, const boost::optional& protobufMessage); void doPruneTo(unsigned int maxSize=250000); uint64_t doDump(int fd); int doWipePacketCache(const DNSName& name, uint16_t qtype=0xffff, bool subtree=false);