From c5c05077e9010142258f9f8db21e99786ad00774 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 6 Apr 2018 16:01:57 +0200 Subject: [PATCH] rec: Pass a ref to an optional pb message for pkt cache insertion --- pdns/recpacketcache.cc | 5 +++-- pdns/recpacketcache.hh | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pdns/recpacketcache.cc b/pdns/recpacketcache.cc index f895c2222f..354c3d47a9 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 9b2ac0e719..40c94e94f5 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); -- 2.47.2