]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
With this cleanup commit, pdns_recursor can compile as C++2011 (CXXFLAGS=-std=gnu...
authorbert hubert <bert.hubert@netherlabs.nl>
Wed, 8 Oct 2014 13:29:30 +0000 (15:29 +0200)
committerbert hubert <bert.hubert@netherlabs.nl>
Wed, 8 Oct 2014 13:29:30 +0000 (15:29 +0200)
pdns/recpacketcache.hh
pdns/recursor_cache.cc
pdns/recursor_cache.hh
pdns/syncres.cc
pdns/syncres.hh
pdns/version.cc
pdns/webserver.cc

index df33ab85002fa1c0cd79909c294e9bac68f28522..3d7d3d9a9268229bc2c4756e11860e112cf2a253 100644 (file)
@@ -62,8 +62,8 @@ inline bool RecursorPacketCache::Entry::operator<(const struct RecursorPacketCac
   const struct dnsheader* 
     dh=(const struct dnsheader*) d_packet.c_str(), 
     *rhsdh=(const struct dnsheader*)rhs.d_packet.c_str();
-  if(make_tuple(dh->opcode, dh->rd, dh->qdcount) < 
-     make_tuple(rhsdh->opcode, rhsdh->rd, rhsdh->qdcount))
+  if(boost::make_tuple(dh->opcode, dh->rd, dh->qdcount) < 
+     boost::make_tuple(rhsdh->opcode, rhsdh->rd, rhsdh->qdcount))
     return true;
 
   return dnspacketLessThan(d_packet, rhs.d_packet);
index 53030baa79c1a25a5803480738fd0a74f08d6c5f..dda3f4266635977e31d5b73ec0d8bab7bdd7ce25 100644 (file)
@@ -187,7 +187,7 @@ bool MemRecursorCache::attemptToRefreshNSTTL(const QType& qt, const set<DNSResou
 void MemRecursorCache::replace(time_t now, const string &qname, const QType& qt,  const set<DNSResourceRecord>& content, bool auth)
 {
   d_cachecachevalid=false;
-  tuple<string, uint16_t> key=make_tuple(qname, qt.getCode());
+  boost::tuple<string, uint16_t> key=boost::make_tuple(qname, qt.getCode());
   cache_t::iterator stored=d_cache.find(key);
   uint32_t maxTTD=UINT_MAX;
 
index 6d2b98596d20bbd350b8e842dc5e9e213c0218c4..d8ce136d71b4f36d33dabe227053872fa86621cb 100644 (file)
@@ -65,7 +65,7 @@ private:
 
   struct CacheEntry
   {
-    CacheEntry(const tuple<string, uint16_t>& key, const vector<StoredRecord>& records, bool auth) : 
+    CacheEntry(const boost::tuple<string, uint16_t>& key, const vector<StoredRecord>& records, bool auth) : 
       d_qname(key.get<0>()), d_qtype(key.get<1>()), d_auth(auth), d_records(records)
     {}
 
index a60cd850d01ab70b11c695420a7fc012e3b82738..533adb87f60a1d0b62c8062aca1e9063382159a4 100644 (file)
@@ -169,7 +169,7 @@ bool SyncRes::doOOBResolve(const string &qname, const QType &qtype, vector<DNSRe
   }
   if(somedata) {
     LOG(prefix<<qname<<": found record in '"<<authdomain<<"', but nothing of the right type, sending SOA"<<endl);
-    ziter=iter->second.d_records.find(make_tuple(authdomain, QType(QType::SOA)));
+    ziter=iter->second.d_records.find(boost::make_tuple(authdomain, QType(QType::SOA)));
     if(ziter!=iter->second.d_records.end()) {
       DNSResourceRecord rr=*ziter;
       rr.d_place=DNSResourceRecord::AUTHORITY;
@@ -185,7 +185,7 @@ bool SyncRes::doOOBResolve(const string &qname, const QType &qtype, vector<DNSRe
   string wcarddomain(qname);
   while(!pdns_iequals(wcarddomain, iter->first) && chopOffDotted(wcarddomain)) {
     LOG(prefix<<qname<<": trying '*."+wcarddomain+"' in "<<authdomain<<endl);
-    range=iter->second.d_records.equal_range(make_tuple("*."+wcarddomain)); 
+    range=iter->second.d_records.equal_range(boost::make_tuple("*."+wcarddomain)); 
     if(range.first==range.second)
       continue;
 
@@ -205,7 +205,7 @@ bool SyncRes::doOOBResolve(const string &qname, const QType &qtype, vector<DNSRe
   string nsdomain(qname);
 
   while(chopOffDotted(nsdomain) && !pdns_iequals(nsdomain, iter->first)) {
-    range=iter->second.d_records.equal_range(make_tuple(nsdomain,QType(QType::NS))); 
+    range=iter->second.d_records.equal_range(boost::make_tuple(nsdomain,QType(QType::NS))); 
     if(range.first==range.second)
       continue;
 
@@ -217,7 +217,7 @@ bool SyncRes::doOOBResolve(const string &qname, const QType &qtype, vector<DNSRe
   }
   if(ret.empty()) { 
     LOG(prefix<<qname<<": no NS match in zone '"<<authdomain<<"' either, handing out SOA"<<endl);
-    ziter=iter->second.d_records.find(make_tuple(authdomain, QType(QType::SOA)));
+    ziter=iter->second.d_records.find(boost::make_tuple(authdomain, QType(QType::SOA)));
     if(ziter!=iter->second.d_records.end()) {
       DNSResourceRecord rr=*ziter;
       rr.d_place=DNSResourceRecord::AUTHORITY;
@@ -906,12 +906,12 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
           LOG(prefix<<qname<<": Trying IP "<< remoteIP->toStringWithPort() <<", asking '"<<qname<<"|"<<qtype.getName()<<"'"<<endl);
           extern NetmaskGroup* g_dontQuery;
           
-          if(t_sstorage->throttle.shouldThrottle(d_now.tv_sec, make_tuple(*remoteIP, "", 0))) {
+          if(t_sstorage->throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(*remoteIP, "", 0))) {
             LOG(prefix<<qname<<": server throttled "<<endl);
             s_throttledqueries++; d_throttledqueries++;
             continue;
           }
-          else if(t_sstorage->throttle.shouldThrottle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()))) {
+          else if(t_sstorage->throttle.shouldThrottle(d_now.tv_sec, boost::make_tuple(*remoteIP, qname, qtype.getCode()))) {
             LOG(prefix<<qname<<": query throttled "<<endl);
             s_throttledqueries++; d_throttledqueries++;
             continue;
@@ -953,18 +953,18 @@ int SyncRes::doResolveAt(set<string, CIStringCompare> nameservers, string auth,
                // code below makes sure we don't filter COM or the root
                 if (s_serverdownmaxfails > 0 && (auth.find('.')+1 != auth.size()) && t_sstorage->fails.incr(*remoteIP) >= s_serverdownmaxfails) {
                   LOG(prefix<<qname<<": Max fails reached resolving on "<< remoteIP->toString() <<". Going full throttle for 1 minute" <<endl);
-                  t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, "", 0), s_serverdownthrottletime, 10000); // mark server as down
+                  t_sstorage->throttle.throttle(d_now.tv_sec, boost::make_tuple(*remoteIP, "", 0), s_serverdownthrottletime, 10000); // mark server as down
                 } else if(resolveret==-1)
-                  t_sstorage->throttle.throttle(d_now.tv_sec, make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // unreachable, 1 minute or 100 queries
+                  t_sstorage->throttle.throttle(d_now.tv_sec, boost::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()), 10, 5);  // timeout
+                  t_sstorage->throttle.throttle(d_now.tv_sec, boost::make_tuple(*remoteIP, qname, qtype.getCode()), 10, 5);  // timeout
               }
               continue;
             }
 
             if(lwr.d_rcode==RCode::ServFail || lwr.d_rcode==RCode::Refused) {
               LOG(prefix<<qname<<": "<<*tns<<" returned a "<< (lwr.d_rcode==RCode::ServFail ? "ServFail" : "Refused") << ", trying sibling IP or NS"<<endl);
-              t_sstorage->throttle.throttle(d_now.tv_sec,make_tuple(*remoteIP, qname, qtype.getCode()),60,3); // servfail or refused
+              t_sstorage->throttle.throttle(d_now.tv_sec,boost::make_tuple(*remoteIP, qname, qtype.getCode()),60,3); // servfail or refused
               continue;
             }
             
@@ -974,7 +974,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); // lame
+            t_sstorage->throttle.throttle(d_now.tv_sec, boost::make_tuple(*remoteIP, qname, qtype.getCode()), 60, 100); // lame
           }
         }
         
index 5182527f058d466d6f1d033efc1ab5f63419c834..c68aca49b0689de220d93b5c1e75ee16d2e9a38a 100644 (file)
@@ -402,7 +402,7 @@ public:
   typedef map<string, AuthDomain, CIStringCompare> domainmap_t;
   
 
-  typedef Throttle<tuple<ComboAddress,string,uint16_t> > throttle_t;
+  typedef Throttle<boost::tuple<ComboAddress,string,uint16_t> > throttle_t;
 
   typedef Counters<ComboAddress> fails_t;
   
index 510ff796c9672c3d042becd71b4ce284f01e7473..7efb4613e4c754493e60ef62ee70de64b392fd98 100644 (file)
@@ -29,9 +29,9 @@ static ProductType productType;
 string compilerVersion()
 {
 #if defined(__clang__)
-  return string("clang "__clang_version__);
+  return string("clang " __clang_version__);
 #elif defined(__GNUC__)
-  return string("gcc "__VERSION__);
+  return string("gcc " __VERSION__);
 #else  // add other compilers here
   return string("Unknown compiler");
 #endif
@@ -61,10 +61,10 @@ string productTypeApiType() {
 
 void showProductVersion()
 {
-  theL()<<Logger::Warning<<productName()<<" "<<PDNS_VERSION<<" ("DIST_HOST") "
+  theL()<<Logger::Warning<<productName()<<" "<< PDNS_VERSION <<" (" DIST_HOST ") "
     "(C) 2001-2014 PowerDNS.COM BV" << endl;
   theL()<<Logger::Warning<<"Using "<<(sizeof(unsigned long)*8)<<"-bits mode. "
-    "Built on "BUILD_DATE" by "BUILD_HOST", "<<compilerVersion()<<"."<<endl;
+    "Built on " BUILD_DATE " by " BUILD_HOST ", "<<compilerVersion()<<"."<<endl;
   theL()<<Logger::Warning<<"PowerDNS comes with ABSOLUTELY NO WARRANTY. "
     "This is free software, and you are welcome to redistribute it "
     "according to the terms of the GPL version 2." << endl;
@@ -104,7 +104,7 @@ void showBuildConfiguration()
 string fullVersionString()
 {
   ostringstream s;
-  s<<productName()<<" "PDNS_VERSION" ("DIST_HOST" built "BUILD_DATE" "BUILD_HOST")";
+  s<<productName()<<" " PDNS_VERSION " (" DIST_HOST " built " BUILD_DATE " " BUILD_HOST ")";
   return s.str();
 }
 
index 6bcda50f40ce7d4b4e7fd88179b0144bed44376c..2e8e3ab91b685a46f42c6057468ccafb55e39b2e 100644 (file)
@@ -213,7 +213,7 @@ HttpResponse WebServer::handleRequest(HttpRequest req)
   }
 
   // always set these headers
-  resp.headers["Server"] = "PowerDNS/"VERSION;
+  resp.headers["Server"] = "PowerDNS/" VERSION;
   resp.headers["Connection"] = "close";
 
   if (req.method == "HEAD") {