Permalink
Browse files

improve non-quiet logging a bit, remove some dead code

  • Loading branch information...
1 parent a903b39 commit 461df9d20c560d240285f772c09b3beb89d46daa @ahupowerdns ahupowerdns committed Jan 6, 2015
Showing with 6 additions and 16 deletions.
  1. +5 −2 pdns/pdns_recursor.cc
  2. +1 −14 pdns/syncres.cc
@@ -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;
}
View
@@ -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)

0 comments on commit 461df9d

Please sign in to comment.