From: Otto Moerbeek Date: Thu, 8 Feb 2024 15:36:09 +0000 (+0100) Subject: Experiment X-Git-Tag: dnsdist-1.9.0~5^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfa7ca8e9054d69af41cc03d866034ca664dcde4;p=thirdparty%2Fpdns.git Experiment --- diff --git a/pdns/dnsdist-lua.cc b/pdns/dnsdist-lua.cc index 50112a3730..1094be77a5 100644 --- a/pdns/dnsdist-lua.cc +++ b/pdns/dnsdist-lua.cc @@ -2230,6 +2230,11 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck) g_policy.setState(policy); }); + luaCtx.writeFunction("setServerPolicy", [](const ServerPolicy* policy) { + setLuaSideEffect(); + g_policy.setState(*policy); + }); + luaCtx.writeFunction("setServerPolicyLua", [](const string& name, ServerPolicy::policyfunc_t policy) { setLuaSideEffect(); g_policy.setState(ServerPolicy{name, policy, true});