From 26f0109a5feb7a1febd55a437678138c8e8dd59d Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 29 Sep 2018 22:02:36 +0200 Subject: net.resolvers.service: Early return on empty result set --- net/resolvers/service.lua | 5 +++++ 1 file changed, 5 insertions(+) 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; -- cgit v1.2.3