Skip to content

Commit

Permalink
Merge pull request #6368 from rgacogne/dnsdist-faster-dynblocks
Browse files Browse the repository at this point in the history
dnsdist: Only update the DynBlock state holders when needed
  • Loading branch information
rgacogne committed Mar 20, 2018
2 parents 90cb19f + 6ddb008 commit aaee3e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pdns/dnsdist-lua.cc
Expand Up @@ -822,6 +822,9 @@ void setupLuaConfig(bool client)

g_lua.writeFunction("addDynBlocks",
[](const std::unordered_map<ComboAddress,unsigned int, ComboAddress::addressOnlyHash, ComboAddress::addressOnlyEqual>& m, const std::string& msg, boost::optional<int> seconds, boost::optional<DNSAction::Action> action) {
if (m.empty()) {
return;
}
setLuaSideEffect();
auto slow = g_dynblockNMG.getCopy();
struct timespec until, now;
Expand Down Expand Up @@ -852,6 +855,9 @@ void setupLuaConfig(bool client)

g_lua.writeFunction("addDynBlockSMT",
[](const vector<pair<unsigned int, string> >&names, const std::string& msg, boost::optional<int> seconds, boost::optional<DNSAction::Action> action) {
if (names.empty()) {
return;
}
setLuaSideEffect();
auto slow = g_dynblockSMT.getCopy();
struct timespec until, now;
Expand Down

0 comments on commit aaee3e9

Please sign in to comment.