std::unique_ptr<NegCache> g_negCache;
thread_local std::unique_ptr<RecursorPacketCache> t_packetCache;
-thread_local FDMultiplexer* t_fdm{nullptr};
+thread_local std::unique_ptr<FDMultiplexer> t_fdm;
thread_local std::unique_ptr<addrringbuf_t> t_remotes, t_servfailremotes, t_largeanswerremotes, t_bogusremotes;
thread_local std::unique_ptr<boost::circular_buffer<pair<DNSName, uint16_t>>> t_queryring, t_servfailqueryring, t_bogusqueryring;
thread_local std::shared_ptr<NetmaskGroup> t_allowFrom;
checkFrameStreamExport(luaconfsLocal);
#endif
- PacketID pident;
+ t_fdm = unique_ptr<FDMultiplexer>(getMultiplexer());
- t_fdm = getMultiplexer();
-
- RecursorWebServer* rws = nullptr;
+ std::unique_ptr<RecursorWebServer> rws;
t_fdm->addReadFD(threadInfo.pipes.readToThread, handlePipeRequest);
if (::arg().mustDo("webserver")) {
g_log << Logger::Warning << "Enabling web server" << endl;
try {
- rws = new RecursorWebServer(t_fdm);
+ rws = make_unique<RecursorWebServer>(t_fdm.get());
}
catch (const PDNSException& e) {
g_log << Logger::Error << "Unable to start the internal web server: " << e.reason << endl;
unsigned int maxTcpClients = ::arg().asNum("max-tcp-clients");
- bool listenOnTCP(true);
+ bool listenOnTCP{true};
time_t last_stat = 0;
time_t last_carbon = 0, last_lua_maintenance = 0;
}
}
}
- delete rws;
- delete t_fdm;
return nullptr;
}
catch (PDNSException& ae) {
std::map<std::string, RecursorLua4::MetaValue> d_meta;
};
-extern thread_local FDMultiplexer* t_fdm;
+extern thread_local unique_ptr<FDMultiplexer> t_fdm;
extern uint16_t g_minUdpSourcePort;
extern uint16_t g_maxUdpSourcePort;
#include "tcpiohandler.hh"
#include "rec-main.hh"
-extern thread_local FDMultiplexer* t_fdm;
-
using json11::Json;
void productServerStatisticsFetch(map<string, string>& out)