Comparison

net/unbound.lua @ 11302:6bb2986783d0

net.unbound: Fix to initialize under prosodyctl Lazy initialization only worked for async queries, but prosodyctl check dns uses sync queries.
author Kim Alvefur <zash@zash.se>
date Thu, 21 Jan 2021 23:33:59 +0100
parent 11253:919e7b962f0b
child 12110:b5b799a2a10c
comparison
equal deleted inserted replaced
11301:d7f0dc727a47 11302:6bb2986783d0
137 end 137 end
138 return ret, err; 138 return ret, err;
139 end 139 end
140 140
141 local function lookup_sync(qname, qtype, qclass) 141 local function lookup_sync(qname, qtype, qclass)
142 if not unbound then initialize(); end
142 qtype = qtype and s_upper(qtype) or "A"; 143 qtype = qtype and s_upper(qtype) or "A";
143 qclass = qclass and s_upper(qclass) or "IN"; 144 qclass = qclass and s_upper(qclass) or "IN";
144 local ntype, nclass = types[qtype], classes[qclass]; 145 local ntype, nclass = types[qtype], classes[qclass];
145 local a, err = unbound:resolve(qname, ntype, nclass); 146 local a, err = unbound:resolve(qname, ntype, nclass);
146 if not a then return a, err; end 147 if not a then return a, err; end