Software /
code /
prosody
Comparison
util/prosodyctl/check.lua @ 11613:c8a9f77d48fd
util.prosodyctl.check: Fix for net.dns vs unbound API difference
net.dns returns nil for NXDOMAIN, while net.unbound returns a table with
zero items and various status fields.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 20 Jun 2021 17:14:17 +0200 |
parent | 11612:bc43731b275a |
child | 11615:8e16fd976c57 |
comparison
equal
deleted
inserted
replaced
11612:bc43731b275a | 11613:c8a9f77d48fd |
---|---|
299 print("Only the domain part ("..host..") is used in DNS.") | 299 print("Only the domain part ("..host..") is used in DNS.") |
300 end | 300 end |
301 local target_hosts = set.new(); | 301 local target_hosts = set.new(); |
302 if modules:contains("c2s") then | 302 if modules:contains("c2s") then |
303 local res = dns.lookup("_xmpp-client._tcp."..idna.to_ascii(host)..".", "SRV"); | 303 local res = dns.lookup("_xmpp-client._tcp."..idna.to_ascii(host)..".", "SRV"); |
304 if res then | 304 if res and #res > 0 then |
305 for _, record in ipairs(res) do | 305 for _, record in ipairs(res) do |
306 if record.srv.target == "." then -- TODO is this an error if mod_c2s is enabled? | 306 if record.srv.target == "." then -- TODO is this an error if mod_c2s is enabled? |
307 print(" 'xmpp-client' service disabled by pointing to '.'"); -- FIXME Explain better what this is | 307 print(" 'xmpp-client' service disabled by pointing to '.'"); -- FIXME Explain better what this is |
308 break; | 308 break; |
309 end | 309 end |
321 end | 321 end |
322 end | 322 end |
323 end | 323 end |
324 if modules:contains("s2s") then | 324 if modules:contains("s2s") then |
325 local res = dns.lookup("_xmpp-server._tcp."..idna.to_ascii(host)..".", "SRV"); | 325 local res = dns.lookup("_xmpp-server._tcp."..idna.to_ascii(host)..".", "SRV"); |
326 if res then | 326 if res and #res > 0 then |
327 for _, record in ipairs(res) do | 327 for _, record in ipairs(res) do |
328 if record.srv.target == "." then -- TODO Is this an error if mod_s2s is enabled? | 328 if record.srv.target == "." then -- TODO Is this an error if mod_s2s is enabled? |
329 print(" 'xmpp-server' service disabled by pointing to '.'"); -- FIXME Explain better what this is | 329 print(" 'xmpp-server' service disabled by pointing to '.'"); -- FIXME Explain better what this is |
330 break; | 330 break; |
331 end | 331 end |