aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-21 23:33:59 +0100
committerKim Alvefur <zash@zash.se>2021-01-21 23:33:59 +0100
commit77ee71daa77d72c5a51a00f56f721e4ba463616e (patch)
treeebd6bee683728140fb4e458027d0b28b1ba028d8
parented63f7f10b384e9cbd8b2ceac11a884979ae7ca1 (diff)
downloadprosody-77ee71daa77d72c5a51a00f56f721e4ba463616e.tar.gz
prosody-77ee71daa77d72c5a51a00f56f721e4ba463616e.zip
net.unbound: Fix to initialize under prosodyctl
Lazy initialization only worked for async queries, but prosodyctl check dns uses sync queries.
-rw-r--r--net/unbound.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/unbound.lua b/net/unbound.lua
index c70f3965..22b0614b 100644
--- a/net/unbound.lua
+++ b/net/unbound.lua
@@ -139,6 +139,7 @@ local function lookup(callback, qname, qtype, qclass)
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];