From: Remi Gacogne Date: Fri, 16 Dec 2016 09:40:55 +0000 (+0100) Subject: rec: Wait until after daemonizing to start the outgoing protobuf thread X-Git-Tag: rec-4.0.5-rc1~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F4792%2Fhead;p=thirdparty%2Fpdns.git rec: Wait until after daemonizing to start the outgoing protobuf thread (cherry picked from commit a79b00a6df3076c1f7af87d0fd093e8aa2fc4e9f) --- diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index 1b91ad85a8..2347b18c21 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -288,11 +288,13 @@ void loadRecursorLuaConfig(const std::string& fname, bool checkOnly) } }); - Lua.writeFunction("outgoingProtobufServer", [&lci](const string& server_, const boost::optional timeout, const boost::optional maxQueuedEntries, const boost::optional reconnectWaitTime, boost::optional asyncConnect) { + Lua.writeFunction("outgoingProtobufServer", [&lci, checkOnly](const string& server_, const boost::optional timeout, const boost::optional maxQueuedEntries, const boost::optional reconnectWaitTime, boost::optional asyncConnect) { try { ComboAddress server(server_); if (!lci.outgoingProtobufServer) { - lci.outgoingProtobufServer = std::make_shared(server, timeout ? *timeout : 2, maxQueuedEntries ? *maxQueuedEntries : 100, reconnectWaitTime ? *reconnectWaitTime : 1, asyncConnect ? *asyncConnect : false); + if (!checkOnly) { + lci.outgoingProtobufServer = std::make_shared(server, timeout ? *timeout : 2, maxQueuedEntries ? *maxQueuedEntries : 100, reconnectWaitTime ? *reconnectWaitTime : 1, asyncConnect ? *asyncConnect : false); + } } else { theL()<toString()<