From 5965ea6a19ad978b4bf1201cbc0a1c460dd54850 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Thu, 30 Jun 2016 17:48:55 +0200 Subject: [PATCH] dnsdist: Return an error on RemoteLog{,Response}Action() w/o protobuf --- pdns/dnsdist-lua2.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index bd72fd468a..f2a1f3f49b 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -668,10 +668,18 @@ void moreLua(bool client) g_lua.writeFunction("setStaleCacheEntriesTTL", [](uint32_t ttl) { g_staleCacheEntriesTTL = ttl; }); g_lua.writeFunction("RemoteLogAction", [](std::shared_ptr logger) { +#ifdef HAVE_PROTOBUF return std::shared_ptr(new RemoteLogAction(logger)); +#else + throw std::runtime_error("Protobuf support is required to use RemoteLogAction"); +#endif }); g_lua.writeFunction("RemoteLogResponseAction", [](std::shared_ptr logger) { +#ifdef HAVE_PROTOBUF return std::shared_ptr(new RemoteLogResponseAction(logger)); +#else + throw std::runtime_error("Protobuf support is required to use RemoteLogResponseAction"); +#endif }); g_lua.writeFunction("newRemoteLogger", [client](const std::string& remote, boost::optional timeout, boost::optional maxQueuedEntries, boost::optional reconnectWaitTime) { return std::make_shared(ComboAddress(remote), timeout ? *timeout : 2, maxQueuedEntries ? *maxQueuedEntries : 100, reconnectWaitTime ? *reconnectWaitTime : 1); -- 2.47.2