};
+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);
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;
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);
#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> >