$NetBSD: patch-pdns__recursor.cc,v 1.4 2015/06/10 14:22:29 fhajny Exp $ Straighten Boost namespace. Cast to int so we use the correct overload. --- pdns_recursor.cc.orig 2015-04-21 13:02:57.000000000 +0000 +++ pdns_recursor.cc @@ -80,12 +80,12 @@ uint64_t g_latencyStatSize; bool g_logCommonErrors; bool g_anyToTcp; uint16_t g_udpTruncationThreshold; -__thread shared_ptr* t_pdl; +__thread boost::shared_ptr* t_pdl; __thread addrringbuf_t* t_remotes, *t_servfailremotes, *t_largeanswerremotes; __thread boost::circular_buffer >* t_queryring, *t_servfailqueryring; -__thread shared_ptr* t_traceRegex; +__thread boost::shared_ptr* t_traceRegex; RecursorControlChannel s_rcc; // only active in thread 0 @@ -169,7 +169,7 @@ struct DNSComboWriter { ComboAddress d_remote, d_local; bool d_tcp; int d_socket; - shared_ptr d_tcpConnection; + boost::shared_ptr d_tcpConnection; }; @@ -661,7 +661,7 @@ void startDoResolve(void *p) IpToU32(i->content, &ip); pw.xfr32BitInt(htonl(ip)); } else { - shared_ptr drc(DNSRecordContent::mastermake(i->qtype.getCode(), i->qclass, i->content)); + boost::shared_ptr drc(DNSRecordContent::mastermake(i->qtype.getCode(), i->qclass, i->content)); drc->toPacket(pw); } if(pw.size() > maxanswersize) { @@ -814,7 +814,7 @@ void makeControlChannelSocket(int proces void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) { - shared_ptr conn=any_cast >(var); + boost::shared_ptr conn=any_cast >(var); if(conn->state==TCPConnection::BYTE0) { int bytes=recv(conn->getFD(), conn->data, 2, 0); @@ -919,7 +919,7 @@ void handleNewTCPQuestion(int fd, FDMult } Utility::setNonBlocking(newsock); - shared_ptr tc(new TCPConnection(newsock, addr)); + boost::shared_ptr tc(new TCPConnection(newsock, addr)); tc->state=TCPConnection::BYTE0; t_fdm->addReadFD(tc->getFD(), handleRunningTCPQuestion, tc); @@ -1081,7 +1081,7 @@ void handleNewUDPQuestion(int fd, FDMult } -typedef vector > > deferredAdd_t; +typedef vector > > deferredAdd_t; deferredAdd_t deferredAdd; void makeTCPServerSockets() @@ -1273,7 +1273,7 @@ void doStats(void) time_t now = time(0); if(lastOutputTime && lastQueryCount && now != lastOutputTime) { - L<(new RecursorLua(fname)); + *t_pdl = boost::shared_ptr(new RecursorLua(fname)); } } catch(std::exception& e) { @@ -1762,7 +1762,7 @@ try return new string("unset\n"); } else { - (*t_traceRegex) = shared_ptr(new Regex(newRegex)); + (*t_traceRegex) = boost::shared_ptr(new Regex(newRegex)); return new string("ok\n"); } } @@ -2096,11 +2096,11 @@ try L<(); + t_pdl = new boost::shared_ptr(); try { if(!::arg()["lua-dns-script"].empty()) { - *t_pdl = shared_ptr(new RecursorLua(::arg()["lua-dns-script"])); + *t_pdl = boost::shared_ptr(new RecursorLua(::arg()["lua-dns-script"])); L<(); + t_traceRegex = new boost::shared_ptr(); unsigned int ringsize=::arg().asNum("stats-ringbuffer-entries") / g_numWorkerThreads; if(ringsize) { t_remotes = new addrringbuf_t(); @@ -2176,7 +2176,7 @@ try expired_t expired=t_fdm->getTimeouts(g_now); for(expired_t::iterator i=expired.begin() ; i != expired.end(); ++i) { - shared_ptr conn=any_cast >(i->second); + boost::shared_ptr conn=any_cast >(i->second); if(g_logCommonErrors) L<d_remote.toString() <removeReadFD(i->first);