From 6ddb008aa98f9793564c1189393285374bba0f1f Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Mon, 19 Mar 2018 19:03:11 +0100 Subject: [PATCH] dnsdist: Only update the DynBlock state holders when needed --- pdns/dnsdist-lua.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.47.2