aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-09-29 22:02:36 +0200
committerKim Alvefur <zash@zash.se>2018-09-29 22:02:36 +0200
commitce0ce78b787f25dd0fb877b91fcea3f1ef61ae85 (patch)
tree1344dab3db60e47a7c257cf6229347241c0eab44
parent06b75d8153078e81e0b87a4da43e8c029882fd70 (diff)
downloadprosody-ce0ce78b787f25dd0fb877b91fcea3f1ef61ae85.tar.gz
prosody-ce0ce78b787f25dd0fb877b91fcea3f1ef61ae85.zip
net.resolvers.service: Early return on empty result set
-rw-r--r--net/resolvers/service.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua
index 036317e5..9e634dbe 100644
--- a/net/resolvers/service.lua
+++ b/net/resolvers/service.lua
@@ -34,6 +34,11 @@ function methods:next(cb)
local dns_resolver = adns.resolver();
dns_resolver:lookup(function (answer)
if answer then
+ if #answer == 0 then
+ ready();
+ return;
+ end
+
if #answer == 1 and answer[1].srv.target == "." then -- No service here
ready();
return;