net.unbound: Fix to initialize under prosodyctl
authorKim Alvefur <zash@zash.se>
Thu, 21 Jan 2021 23:33:59 +0100
changeset 11306 6bb2986783d0
parent 11305 d7f0dc727a47
child 11307 0d932bf3a0f7
net.unbound: Fix to initialize under prosodyctl Lazy initialization only worked for async queries, but prosodyctl check dns uses sync queries.
net/unbound.lua
--- a/net/unbound.lua	Thu Jan 21 19:23:15 2021 +0100
+++ b/net/unbound.lua	Thu Jan 21 23:33:59 2021 +0100
@@ -139,6 +139,7 @@
 end
 
 local function lookup_sync(qname, qtype, qclass)
+	if not unbound then initialize(); end
 	qtype = qtype and s_upper(qtype) or "A";
 	qclass = qclass and s_upper(qclass) or "IN";
 	local ntype, nclass = types[qtype], classes[qclass];