From: n0tlu5 Date: Sun, 22 Dec 2024 08:03:11 +0000 (+0700) Subject: adds required checkurl url params X-Git-Tag: dnsdist-2.0.0-alpha1~178^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7852245c92b91f6f9a26a63e5aae1ef2e965dd45;p=thirdparty%2Fpdns.git adds required checkurl url params --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index 4653588f69..d731698b4a 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -1178,10 +1178,11 @@ static void setupLuaRecords(LuaContext& lua) // NOLINT(readability-function-cogn /* * Based on the hash of `bestwho`, returns an IP address from the list * supplied, weighted according to the results of isUp calls. - * @example pickselfweighted("{ "192.0.2.20", "203.0.113.4", "203.0.113.2" }) + * @example pickselfweighted('http://example.com/weight', { "192.0.2.20", "203.0.113.4", "203.0.113.2" }) */ - lua.writeFunction("pickselfweighted", [](const iplist_t& ips, - boost::optional options) { + lua.writeFunction("pickselfweighted", [](const std::string& url, + const iplist_t& ips, + boost::optional options) { vector< pair > items; opts_t opts; if(options) @@ -1193,7 +1194,7 @@ static void setupLuaRecords(LuaContext& lua) // NOLINT(readability-function-cogn vector conv = convComboAddressList(ips); for (auto& entry : conv) { int weight = 0; - weight = g_up.isUp(entry, opts); + weight = g_up.isUp(entry, url, opts); if(weight>0){ available = 1; }