From a79b00a6df3076c1f7af87d0fd093e8aa2fc4e9f Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 16 Dec 2016 10:40:55 +0100 Subject: [PATCH] rec: Wait until after daemonizing to start the outgoing protobuf thread --- pdns/rec-lua-conf.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index 32afe58f0..fe7d5570d 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -296,11 +296,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()<