From: bert hubert Date: Wed, 8 Oct 2014 13:29:30 +0000 (+0200) Subject: With this cleanup commit, pdns_recursor can compile as C++2011 (CXXFLAGS=-std=gnu... X-Git-Tag: rec-3.7.0-rc1~207 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41ea0e50ebe8ad174416482ba30bb15cfdf5d0b9;p=thirdparty%2Fpdns.git With this cleanup commit, pdns_recursor can compile as C++2011 (CXXFLAGS=-std=gnu++0x make -j4). --- diff --git a/pdns/recpacketcache.hh b/pdns/recpacketcache.hh index df33ab8500..3d7d3d9a92 100644 --- a/pdns/recpacketcache.hh +++ b/pdns/recpacketcache.hh @@ -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); diff --git a/pdns/recursor_cache.cc b/pdns/recursor_cache.cc index 53030baa79..dda3f42666 100644 --- a/pdns/recursor_cache.cc +++ b/pdns/recursor_cache.cc @@ -187,7 +187,7 @@ bool MemRecursorCache::attemptToRefreshNSTTL(const QType& qt, const set& content, bool auth) { d_cachecachevalid=false; - tuple key=make_tuple(qname, qt.getCode()); + boost::tuple key=boost::make_tuple(qname, qt.getCode()); cache_t::iterator stored=d_cache.find(key); uint32_t maxTTD=UINT_MAX; diff --git a/pdns/recursor_cache.hh b/pdns/recursor_cache.hh index 6d2b98596d..d8ce136d71 100644 --- a/pdns/recursor_cache.hh +++ b/pdns/recursor_cache.hh @@ -65,7 +65,7 @@ private: struct CacheEntry { - CacheEntry(const tuple& key, const vector& records, bool auth) : + CacheEntry(const boost::tuple& key, const vector& records, bool auth) : d_qname(key.get<0>()), d_qtype(key.get<1>()), d_auth(auth), d_records(records) {} diff --git a/pdns/syncres.cc b/pdns/syncres.cc index a60cd850d0..533adb87f6 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -169,7 +169,7 @@ bool SyncRes::doOOBResolve(const string &qname, const QType &qtype, vectorsecond.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, vectorfirst) && chopOffDotted(wcarddomain)) { LOG(prefix<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, vectorfirst)) { - 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, vectorsecond.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 nameservers, string auth, LOG(prefix<toStringWithPort() <<", asking '"<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<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< 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<toString() <<". Going full throttle for 1 minute" <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<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 nameservers, string auth, break; // this IP address worked! wasLame:; // well, it didn't LOG(prefix<toString() <<") is lame for '"<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 } } diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 5182527f05..c68aca49b0 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -402,7 +402,7 @@ public: typedef map domainmap_t; - typedef Throttle > throttle_t; + typedef Throttle > throttle_t; typedef Counters fails_t; diff --git a/pdns/version.cc b/pdns/version.cc index 510ff796c9..7efb4613e4 100644 --- a/pdns/version.cc +++ b/pdns/version.cc @@ -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()<