From ea072d7c3275099daf6de2a20d52e227f5ec14e7 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 29 Sep 2018 21:56:47 +0200 Subject: net.resolvers.service: Understand when service is explicitly unavailable RFC2782 states: > A Target of "." means that the service is decidedly not available at > this domain. --- net/resolvers/service.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/resolvers/service.lua b/net/resolvers/service.lua index 736a838b..036317e5 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 == 1 and answer[1].srv.target == "." then -- No service here + ready(); + return; + end + table.sort(answer, function (a, b) return a.priority > b.priority end); for _, record in ipairs(answer) do table.insert(targets, { record.srv.target, record.srv.port, self.conn_type, self.extra }); -- cgit v1.2.3