From: Remi Gacogne Date: Mon, 19 Mar 2018 18:03:11 +0000 (+0100) Subject: dnsdist: Only update the DynBlock state holders when needed X-Git-Tag: dnsdist-1.3.0~48^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F6368%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Only update the DynBlock state holders when needed --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index dfe31e4e05..97f589fa11 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -822,6 +822,9 @@ void setupLuaConfig(bool client) g_lua.writeFunction("addDynBlocks", [](const std::unordered_map& m, const std::string& msg, boost::optional seconds, boost::optional action) { + if (m.empty()) { + return; + } setLuaSideEffect(); auto slow = g_dynblockNMG.getCopy(); struct timespec until, now; @@ -852,6 +855,9 @@ void setupLuaConfig(bool client) g_lua.writeFunction("addDynBlockSMT", [](const vector >&names, const std::string& msg, boost::optional seconds, boost::optional action) { + if (names.empty()) { + return; + } setLuaSideEffect(); auto slow = g_dynblockSMT.getCopy(); struct timespec until, now;