]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
improve non-quiet logging a bit, remove some dead code
authorbert hubert <bert.hubert@netherlabs.nl>
Tue, 6 Jan 2015 14:25:08 +0000 (15:25 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Tue, 6 Jan 2015 14:25:08 +0000 (15:25 +0100)
pdns/pdns_recursor.cc
pdns/syncres.cc

index 7349a8841050170dc2fe8d53179d548c34dbaaa5..fdb25fee7cec7e95a480b9687c0d5f4c3d9c36ad 100644 (file)
@@ -571,7 +571,7 @@ void startDoResolve(void *p)
     }
     
     if(!g_quiet || tracedQuery)
-      L<<Logger::Warning<<t_id<<" ["<<MT->getTid()<<"] " << (dc->d_tcp ? "TCP " : "") << "question for '"<<dc->d_mdp.d_qname<<"|"
+      L<<Logger::Warning<<t_id<<" ["<<MT->getTid()<<"/"<<MT->numProcesses()<<"] " << (dc->d_tcp ? "TCP " : "") << "question for '"<<dc->d_mdp.d_qname<<"|"
        <<DNSRecordContent::NumberToType(dc->d_mdp.d_qtype)<<"' from "<<dc->getRemote()<<endl;
 
     sr.setId(MT->getTid());
@@ -722,7 +722,7 @@ void startDoResolve(void *p)
     }
     
     if(!g_quiet) {
-      L<<Logger::Error<<t_id<<" ["<<MT->getTid()<<"] answer to "<<(dc->d_mdp.d_header.rd?"":"non-rd ")<<"question '"<<dc->d_mdp.d_qname<<"|"<<DNSRecordContent::NumberToType(dc->d_mdp.d_qtype);
+      L<<Logger::Error<<t_id<<" ["<<MT->getTid()<<"/"<<MT->numProcesses()<<"] answer to "<<(dc->d_mdp.d_header.rd?"":"non-rd ")<<"question '"<<dc->d_mdp.d_qname<<"|"<<DNSRecordContent::NumberToType(dc->d_mdp.d_qtype);
       L<<"': "<<ntohs(pw.getHeader()->ancount)<<" answers, "<<ntohs(pw.getHeader()->arcount)<<" additional, took "<<sr.d_outqueries<<" packets, "<<
       sr.d_throttledqueries<<" throttled, "<<sr.d_timeouts<<" timeouts, "<<sr.d_tcpoutqueries<<" tcp connections, rcode="<<res<<endl;
     }
@@ -946,6 +946,9 @@ string* doProcessUDPQuestion(const std::string& question, const ComboAddress& fr
   }
   
   if(MT->numProcesses() > g_maxMThreads) {
+    if(!g_quiet)
+      L<<Logger::Warning<<t_id<<" ["<<MT->getTid()<<"/"<<MT->numProcesses()<<"] DROPPED question from "<<fromaddr.toStringWithPort()<<", over capacity"<<endl;
+
     g_stats.overCapacityDrops++;
     return 0;
   }
index f2af138e5fb14e01bcafc66312c0f2eb620c950d..d10e04922454bab0e1fb44e8ad357f0a5527ba87 100644 (file)
@@ -775,6 +775,7 @@ inline vector<string> SyncRes::shuffleInSpeedOrder(set<string, CIStringCompare>
     rnameservers.push_back(str);
   }
   map<string, double> speeds;
+
   BOOST_FOREACH(const string& val, rnameservers) {
     double speed;
     speed=t_sstorage->nsSpeeds[val].get(&d_now);
@@ -1194,20 +1195,6 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
   return -1;
 }
 
-void SyncRes::addAuthorityRecords(const string& qname, vector<DNSResourceRecord>& ret, int depth)
-{
-  set<DNSResourceRecord> bestns;
-  set<GetBestNSAnswer> beenthere;
-  bool dontcare;
-  getBestNSFromCache(qname, bestns, &dontcare, depth, beenthere);
-
-  for(set<DNSResourceRecord>::const_iterator k=bestns.begin();k!=bestns.end();++k) {
-    DNSResourceRecord ns=*k;
-    ns.d_place=DNSResourceRecord::AUTHORITY;
-    ns.ttl-=d_now.tv_sec;
-    ret.push_back(ns);
-  }
-}
 
 // used by PowerDNSLua - note that this neglects to add the packet count & statistics back to pdns_ercursor.cc
 int directResolve(const std::string& qname, const QType& qtype, int qclass, vector<DNSResourceRecord>& ret)