From: bert hubert Date: Wed, 2 Mar 2016 13:59:24 +0000 (+0100) Subject: make it explicit that servfail packets get stored for servfail-packetcache-ttl seconds X-Git-Tag: rec-4.0.0-alpha2~24^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76e2b9e341d6ae1243e7f84c6fec629803788137;p=thirdparty%2Fpdns.git make it explicit that servfail packets get stored for servfail-packetcache-ttl seconds --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 00887eac1a..19cb2a4242 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -872,14 +872,13 @@ void startDoResolve(void *p) msgh.msg_control=NULL; if(sendmsg(dc->d_socket, &msgh, 0) < 0 && g_logCommonErrors) L<d_remote.toStringWithPort()<<" failed with: "<insertResponsePacket(dc->d_tag, dc->d_mdp.d_qname, dc->d_mdp.d_qtype, dc->d_query, string((const char*)&*packet.begin(), packet.size()), + + t_packetCache->insertResponsePacket(dc->d_tag, dc->d_mdp.d_qname, dc->d_mdp.d_qtype, dc->d_query, + string((const char*)&*packet.begin(), packet.size()), g_now.tv_sec, - min(minTTL, - (pw.getHeader()->rcode == RCode::ServFail) ? SyncRes::s_packetcacheservfailttl : SyncRes::s_packetcachettl - ) - ); + pw.getHeader()->rcode == RCode::ServFail ? SyncRes::s_packetcacheservfailttl : + min(minTTL,SyncRes::s_packetcachettl)); } // else cerr<<"Not putting in packet cache: "<