From 60c8afa89fa5394914958a007ae2263924fe167f Mon Sep 17 00:00:00 2001 From: bert hubert Date: Sat, 3 Jan 2015 11:12:12 +0100 Subject: [PATCH] work around a compiler/boost bug (unsure who is really to blame) --- pdns/iputils.hh | 15 +++++++++++++++ pdns/pdns_recursor.cc | 10 ++++++---- pdns/statbag.hh | 9 --------- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/pdns/iputils.hh b/pdns/iputils.hh index 5230443536..7b7ce62824 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 158c7b8c67..7b1e70c2e7 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 ae260f59ef..b95200a518 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 > -- 2.47.2