From: Remi Gacogne Date: Thu, 30 Jun 2016 15:48:55 +0000 (+0200) Subject: dnsdist: Return an error on RemoteLog{,Response}Action() w/o protobuf X-Git-Tag: rec-4.0.2~50^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5965ea6a19ad978b4bf1201cbc0a1c460dd54850;p=thirdparty%2Fpdns.git dnsdist: Return an error on RemoteLog{,Response}Action() w/o protobuf --- 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);