From f4c4e7fd28c7c140f0d3612b67b331379a2adf2d Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 8 Jan 2016 09:54:12 +0100 Subject: [PATCH] dnsdist: make topBandwidth() default to the top 10 clients Closes #3189. --- pdns/dnsdist-lua2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index b43afdf47..94bdd1cc3 100644 --- a/pdns/dnsdist-lua2.cc +++ b/pdns/dnsdist-lua2.cc @@ -208,8 +208,9 @@ void moreLua() }); - g_lua.writeFunction("topBandwidth", [](unsigned int top) { + g_lua.writeFunction("topBandwidth", [](boost::optional top_) { setLuaNoSideEffect(); + auto top = top_.get_value_or(10); auto res = g_rings.getTopBandwidth(top); boost::format fmt("%7d %s\n"); for(const auto& l : res) { -- 2.40.0