]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
let topClients() default to top-10
authorbert hubert <bert.hubert@netherlabs.nl>
Mon, 7 Dec 2015 09:44:52 +0000 (10:44 +0100)
committerbert hubert <bert.hubert@netherlabs.nl>
Mon, 7 Dec 2015 09:45:18 +0000 (10:45 +0100)
pdns/dnsdist-lua.cc

index 4b482c2c7131c8f5ece9de72803b37c319b280fe..91983ee5c31b2a3db70ada03e2315a3d3d080766 100644 (file)
@@ -658,7 +658,8 @@ vector<std::function<void(void)>> setupLua(bool client, const std::string& confi
     });
 
 
-  g_lua.writeFunction("topClients", [](unsigned int top) {
+  g_lua.writeFunction("topClients", [](boost::optional<unsigned int> top_) {
+      auto top = top_.get_value_or(10);
       map<ComboAddress, int,ComboAddress::addressOnlyLessThan > counts;
       unsigned int total=0;
       {