From: Remi Gacogne Date: Fri, 8 Jan 2016 08:54:12 +0000 (+0100) Subject: dnsdist: make topBandwidth() default to the top 10 clients X-Git-Tag: dnsdist-1.0.0-alpha2~109^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4c4e7fd28c7c140f0d3612b67b331379a2adf2d;p=thirdparty%2Fpdns.git dnsdist: make topBandwidth() default to the top 10 clients Closes #3189. --- diff --git a/pdns/dnsdist-lua2.cc b/pdns/dnsdist-lua2.cc index b43afdf476..94bdd1cc3f 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) {