]> granicus.if.org Git - pdns/commitdiff
work around a compiler/boost bug (unsure who is really to blame)
authorbert hubert <bert.hubert@netherlabs.nl>
Sat, 3 Jan 2015 10:12:12 +0000 (11:12 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Sat, 3 Jan 2015 10:12:12 +0000 (11:12 +0100)
pdns/iputils.hh
pdns/pdns_recursor.cc
pdns/statbag.hh

index 5230443536c4bc01c5e4987214a7ef7d5839ff92..7b7ce628242d9d1e1bd9595105565c93fbee3e63 100644 (file)
@@ -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);
index 158c7b8c6799d67cdcd1c6cd129251996d26a1c9..7b1e70c2e7accecd3ec731ed580419b1d5666ab2 100644 (file)
@@ -81,7 +81,9 @@ bool g_logCommonErrors;
 bool g_anyToTcp;
 uint16_t g_udpTruncationThreshold;
 __thread shared_ptr<RecursorLua>* t_pdl;
-__thread boost::circular_buffer<ComboAddress>* t_remotes, *t_servfailremotes, *t_largeanswerremotes;
+
+__thread addrringbuf_t* t_remotes, *t_servfailremotes, *t_largeanswerremotes;
+
 __thread boost::circular_buffer<pair<std::string, uint16_t> >* t_queryring, *t_servfailqueryring;
 __thread shared_ptr<Regex>* t_traceRegex;
 
@@ -2011,11 +2013,11 @@ try
   t_traceRegex = new shared_ptr<Regex>();
   unsigned int ringsize=::arg().asNum("stats-ringbuffer-entries") / g_numThreads;
   if(ringsize) {
-    t_remotes = new boost::circular_buffer<ComboAddress>();
+    t_remotes = new addrringbuf_t();
     t_remotes->set_capacity(ringsize);   
-    t_servfailremotes = new boost::circular_buffer<ComboAddress>();
+    t_servfailremotes = new addrringbuf_t();
     t_servfailremotes->set_capacity(ringsize);   
-    t_largeanswerremotes = new boost::circular_buffer<ComboAddress>();
+    t_largeanswerremotes = new addrringbuf_t();
     t_largeanswerremotes->set_capacity(ringsize);   
 
 
index ae260f59efffaa6b34be62d1a15b0c2ce6d75086..b95200a51898483662198ce5808e61bbaab65e48 100644 (file)
 #include "iputils.hh"
 #include <boost/circular_buffer.hpp>
 
-struct SComboAddress
-{
-  SComboAddress(const ComboAddress& orig) : ca(orig) {}
-  ComboAddress ca;
-  bool operator<(const SComboAddress& rhs) const
-  {
-    return ComboAddress::addressOnlyLessThan()(ca, rhs.ca);
-  }
-};
 
 
 template<typename T, typename Comp=std::less<T> >