From c348fec2f60ebcf29df6b64ea58d8c6970295a20 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 22 Jun 2016 19:42:00 +0200 Subject: [PATCH] make DNSName.toLogString() default for logs --- pdns/dnsproxy.cc | 2 +- pdns/logger.cc | 2 +- pdns/packethandler.cc | 6 +++--- pdns/syncres.cc | 12 ++++++------ pdns/ueberbackend.cc | 18 +++++++++--------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/pdns/dnsproxy.cc b/pdns/dnsproxy.cc index 1282744b4..3c6fcf8b9 100644 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@ -234,7 +234,7 @@ void DNSProxy::mainloop(void) if(p.qtype.getCode() != i->second.qtype || p.qdomain != i->second.qname) { L<second.qtype<<", "<second.qname.toLogString()<<")"<second.qtype<<", "<second.qname<<")"<qdomain.toLogString()<<"/"<qtype.getName()<<" ("<qdomain<<"/"<qtype.getName()<<" ("<replyPacket(); // generate an empty reply packet r->setRcode(RCode::ServFail); diff --git a/pdns/syncres.cc b/pdns/syncres.cc index c5147d443..ee822aca6 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -988,7 +988,7 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con } else { if(!tns->empty()) { - LOG(prefix<toLogString()<< "' ("<<1+tns-rnameservers.begin()<<"/"<<(unsigned int)rnameservers.size()<<")"<toLogString()<<", trying next if available"<toLogString()<<" to: "); + LOG(prefix< 6.0 && d_timeouts > 2) throw ImmediateServFailException("Too much work resolving "+qname+"|"+qtype.getName()+", timeouts: "+std::to_string(d_timeouts) +", throttles: "+std::to_string(d_throttledqueries)); if(lwr.d_rcode==RCode::ServFail || lwr.d_rcode==RCode::Refused) { - LOG(prefix<toLogString()<<" ("<toString()<<") returned a "<< (lwr.d_rcode==RCode::ServFail ? "ServFail" : "Refused") << ", trying sibling IP or NS"<toString()<<") returned a "<< (lwr.d_rcode==RCode::ServFail ? "ServFail" : "Refused") << ", trying sibling IP or NS"<throttle.throttle(d_now.tv_sec,boost::make_tuple(*remoteIP, qname, qtype.getCode()),60,3); // servfail or refused continue; } @@ -1120,7 +1120,7 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con break; // this IP address worked! wasLame:; // well, it didn't - LOG(prefix<toLogString()<<" ("<< remoteIP->toString() <<") is lame for '"<toString() <<") is lame for '"<throttle.throttle(d_now.tv_sec, boost::make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // lame } } @@ -1137,7 +1137,7 @@ int SyncRes::doResolveAt(NsSet &nameservers, DNSName auth, bool flawedNSSet, con LOG(prefix<toLogString()<<" ("<< remoteIP->toString() <<"), rcode="<toString() <<"), rcode="<sin4.sin_family==AF_INET6) diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 25fbeb828..9557b36fc 100644 --- a/pdns/ueberbackend.cc +++ b/pdns/ueberbackend.cc @@ -264,7 +264,7 @@ bool UeberBackend::getAuth(DNSPacket *p, SOAData *sd, const DNSName &target) cstat = cacheHas(d_question,d_answers); if(cstat == 1 && !d_answers.empty() && d_cache_ttl) { - DLOG(L<domain_id = d_answers[0].domain_id; sd->ttl = d_answers[0].ttl; @@ -272,7 +272,7 @@ bool UeberBackend::getAuth(DNSPacket *p, SOAData *sd, const DNSName &target) sd->qname = choppedOff; goto found; } else if(cstat == 0 && d_negcache_ttl) { - DLOG(L<first < choppedOff.wirelength()) { - DLOG(L<second.qname.toLogString()<second.qname<first == choppedOff.wirelength()) { - DLOG(L<second.qname.toLogString()<second.qname<second; break; } else { @@ -308,7 +308,7 @@ bool UeberBackend::getAuth(DNSPacket *p, SOAData *sd, const DNSName &target) break; } } else { - DLOG(L<qname.toLogString()<qname<qname; d_question.zoneId = -1; @@ -341,10 +341,10 @@ bool UeberBackend::getAuth(DNSPacket *p, SOAData *sd, const DNSName &target) found: if(found == (p->qtype == QType::DS)){ - DLOG(L<qname.toLogString()<qname<qname.toLogString()<qname<