From: bert hubert Date: Sat, 3 Jan 2015 10:12:12 +0000 (+0100) Subject: work around a compiler/boost bug (unsure who is really to blame) X-Git-Tag: rec-3.7.0-rc1~67^2~6^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60c8afa89fa5394914958a007ae2263924fe167f;p=pdns work around a compiler/boost bug (unsure who is really to blame) --- diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 523044353..7b7ce6282 100644 --- a/pdns/iputils.hh +++ b/pdns/iputils.hh @@ -411,6 +411,21 @@ private: }; +struct SComboAddress +{ + SComboAddress(const ComboAddress& orig) : ca(orig) {} + ComboAddress ca; + bool operator<(const SComboAddress& rhs) const + { + return ComboAddress::addressOnlyLessThan()(ca, rhs.ca); + } + operator const ComboAddress&() + { + return ca; + } +}; + + int SSocket(int family, int type, int flags); int SConnect(int sockfd, const ComboAddress& remote); int SBind(int sockfd, const ComboAddress& local); diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 158c7b8c6..7b1e70c2e 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -81,7 +81,9 @@ bool g_logCommonErrors; bool g_anyToTcp; uint16_t g_udpTruncationThreshold; __thread shared_ptr* t_pdl; -__thread boost::circular_buffer* t_remotes, *t_servfailremotes, *t_largeanswerremotes; + +__thread addrringbuf_t* t_remotes, *t_servfailremotes, *t_largeanswerremotes; + __thread boost::circular_buffer >* t_queryring, *t_servfailqueryring; __thread shared_ptr* t_traceRegex; @@ -2011,11 +2013,11 @@ try t_traceRegex = new shared_ptr(); unsigned int ringsize=::arg().asNum("stats-ringbuffer-entries") / g_numThreads; if(ringsize) { - t_remotes = new boost::circular_buffer(); + t_remotes = new addrringbuf_t(); t_remotes->set_capacity(ringsize); - t_servfailremotes = new boost::circular_buffer(); + t_servfailremotes = new addrringbuf_t(); t_servfailremotes->set_capacity(ringsize); - t_largeanswerremotes = new boost::circular_buffer(); + t_largeanswerremotes = new addrringbuf_t(); t_largeanswerremotes->set_capacity(ringsize); diff --git a/pdns/statbag.hh b/pdns/statbag.hh index ae260f59e..b95200a51 100644 --- a/pdns/statbag.hh +++ b/pdns/statbag.hh @@ -31,15 +31,6 @@ #include "iputils.hh" #include -struct SComboAddress -{ - SComboAddress(const ComboAddress& orig) : ca(orig) {} - ComboAddress ca; - bool operator<(const SComboAddress& rhs) const - { - return ComboAddress::addressOnlyLessThan()(ca, rhs.ca); - } -}; template >