Changeset

9392:f2d71e4284b7

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.
author Kim Alvefur <zash@zash.se>
date Sat, 29 Sep 2018 21:56:47 +0200 (2018-09-29)
parents 9391:4001eb3f465a
children 9393:e2733f504d9e
files net/resolvers/service.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 });