]> granicus.if.org Git - pdns/commitdiff
our 'throttle' code would do one final 'throttle' long after the time limit had expir...
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 29 Dec 2010 08:58:54 +0000 (08:58 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 29 Dec 2010 08:58:54 +0000 (08:58 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1766 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/syncres.cc
pdns/syncres.hh

index 4b05acfc5b5c442a9ad268712739fc7c22fc2fb1..f1532066a2997f4c8b77ec199095327dddb04496 100644 (file)
@@ -904,9 +904,9 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
                  t_sstorage->nsSpeeds[*tns].submit(*remoteIP, 1000000, &d_now); // 1 sec
                }
                if(resolveret==-1)
-                 t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // unreachable
+                 t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // unreachable, 1 minute or 100 queries
                else
-                 t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 20, 5);  // timeout
+                 t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 10, 5);  // timeout
               }
               continue;
             }
@@ -914,7 +914,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
             break;  // this IP address worked!
           wasLame:; // well, it didn't
             LOG<<prefix<<qname<<": status=NS "<<*tns<<" ("<< remoteIP->toString() <<") is lame for '"<<auth<<"', trying sibling IP or NS"<<endl;
-            t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100);
+            t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // lame
           }
         }
         
@@ -933,7 +933,7 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
         
         if(lwr.d_rcode==RCode::ServFail) {
           LOG<<prefix<<qname<<": "<<*tns<<" returned a ServFail, trying sibling IP or NS"<<endl;
-          t_sstorage->throttle.throttle(d_now.tv_sec,make_tuple(*remoteIP, qname, qtype.getCode()),60,3);
+          t_sstorage->throttle.throttle(d_now.tv_sec,make_tuple(*remoteIP, qname, qtype.getCode()),60,3); // servfail
           continue;
         }
         LOG<<prefix<<qname<<": Got "<<(unsigned int)lwr.d_result.size()<<" answers from "<<*tns<<" ("<< remoteIP->toString() <<"), rcode="<<lwr.d_rcode<<", in "<<lwr.d_usec/1000<<"ms"<<endl;
index a1e5d2a9cb61616861f161e3bb7692da42942e6f..82adc2422b432e2a0492eb184a34ec5205390251 100644 (file)
@@ -64,6 +64,7 @@ public:
       return false;
     if(now > i->second.ttd || i->second.count-- < 0) {
       d_cont.erase(i);
+      return false;
     }
 
     return true; // still listed, still blocked