# HG changeset patch # User Kim Alvefur # Date 1538251007 -7200 # Node ID f2d71e4284b75ce2abe9035e72876762ef897e34 # Parent 4001eb3f465a06dae9e9845a18b5f061a26c86b0 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. diff -r 4001eb3f465a -r f2d71e4284b7 net/resolvers/service.lua --- a/net/resolvers/service.lua Sat Sep 29 16:29:30 2018 +0200 +++ b/net/resolvers/service.lua Sat Sep 29 21:56:47 2018 +0200 @@ -34,6 +34,11 @@ 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 });