From: Peter van Dijk Date: Mon, 3 Jun 2019 16:00:09 +0000 (+0200) Subject: reuse AuthLua4 object X-Git-Tag: dnsdist-1.4.0-beta1~4^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd1bdfb3dd78f94470efbf3eca1c53a7a720c074;p=pdns reuse AuthLua4 object --- diff --git a/pdns/lua-record.cc b/pdns/lua-record.cc index 3ebed5dcd..3d757415f 100644 --- a/pdns/lua-record.cc +++ b/pdns/lua-record.cc @@ -465,13 +465,19 @@ static vector > convWIplist(std::unordered_map alua; + std::vector> luaSynth(const std::string& code, const DNSName& query, const DNSName& zone, int zoneid, const DNSPacket& dnsp, uint16_t qtype) { - AuthLua4 alua; + if(!alua) { + cerr<<"initializing AuthLua4"<(); + } std::vector> ret; - LuaContext& lua = *alua.getLua(); + LuaContext& lua = *alua->getLua(); lua.writeVariable("qname", query); lua.writeVariable("who", dnsp.getRemote()); lua.writeVariable("dh", (dnsheader*)&dnsp.d);