Skip to content

Commit 30b13ef

Browse files
committed
do not apply some of our filters to root and gtlds, plus remove some useless {}
1 parent 79f9323 commit 30b13ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pdns/syncres.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
PowerDNS Versatile Database Driven Nameserver
3-
Copyright (C) 2003 - 2013 PowerDNS.COM BV
3+
Copyright (C) 2003 - 2014 PowerDNS.COM BV
44
55
This program is free software; you can redistribute it and/or modify
66
it under the terms of the GNU General Public License version 2 as published
@@ -931,7 +931,8 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
931931

932932
resolveret=asyncresolveWrapper(*remoteIP, qname, qtype.getCode(),
933933
doTCP, sendRDQuery, &d_now, &lwr); // <- we go out on the wire!
934-
if(resolveret != 1) {
934+
935+
if(resolveret != 1) {
935936
if(resolveret==0) {
936937
LOG(prefix<<qname<<": timeout resolving "<< (doTCP ? "over TCP" : "")<<endl);
937938
d_timeouts++;
@@ -945,13 +946,12 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
945946
s_unreachables++; d_unreachables++;
946947
LOG(prefix<<qname<<": error resolving"<< (doTCP ? " over TCP" : "") <<", possible error: "<<strerror(errno)<< endl);
947948
}
948-
949+
949950
if(resolveret!=-2) { // don't account for resource limits, they are our own fault
950-
{
951-
952-
t_sstorage->nsSpeeds[*tns].submit(*remoteIP, 1000000, &d_now); // 1 sec
953-
}
954-
if (s_serverdownmaxfails > 0 && t_sstorage->fails.incr(*remoteIP) >= s_serverdownmaxfails) {
951+
t_sstorage->nsSpeeds[*tns].submit(*remoteIP, 1000000, &d_now); // 1 sec
952+
953+
// code below makes sure we don't filter COM or the root
954+
if (s_serverdownmaxfails > 0 && (auth.find('.')+1 != auth.size()) && t_sstorage->fails.incr(*remoteIP) >= s_serverdownmaxfails) {
955955
LOG(prefix<<qname<<": Max fails reached resolving on "<< remoteIP->toString() <<". Going full throttle for 1 minute" <<endl);
956956
t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, "", 0), s_serverdownthrottletime, 10000); // mark server as down
957957
} else if(resolveret==-1)

0 commit comments

Comments
 (0)