From b8f933295b268d7c59462c2d1893c29ae706082d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Wed, 25 Oct 2017 17:27:05 +0200 Subject: [PATCH] dnsdist: Don't create a Remote Logger in client mode --- pdns/dnsdist-lua2.cc | 3 +++ pdns/dnsrulactions.hh | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index 40c195f4b..7e043ef39 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -875,6 +875,9 @@ void moreLua(bool client) }); g_lua.writeFunction("newRemoteLogger", [client](const std::string& remote, boost::optional timeout, boost::optional maxQueuedEntries, boost::optional reconnectWaitTime) { + if (client) { + return std::shared_ptr(); + } return std::make_shared(ComboAddress(remote), timeout ? *timeout : 2, maxQueuedEntries ? *maxQueuedEntries : 100, reconnectWaitTime ? *reconnectWaitTime : 1); }); diff --git a/pdns/dnsrulactions.hh b/pdns/dnsrulactions.hh index 2730ba565..6c26a5a06 100644 --- a/pdns/dnsrulactions.hh +++ b/pdns/dnsrulactions.hh @@ -1272,7 +1272,7 @@ public: } string toString() const override { - return "remote log to " + d_logger->toString(); + return "remote log to " + (d_logger ? d_logger->toString() : ""); } private: std::shared_ptr d_logger; @@ -1329,7 +1329,7 @@ public: } string toString() const override { - return "remote log response to " + d_logger->toString(); + return "remote log response to " + (d_logger ? d_logger->toString() : ""); } private: std::shared_ptr d_logger; -- 2.40.0