Software /
code /
prosody
Comparison
net/resolvers/service.lua @ 9394:bcd94cc355d3
net.resolvers.service: Add support for fallback to bare domain and default port
The default port must be configured separately to enable this behavior
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 29 Sep 2018 22:03:16 +0200 |
parent | 9393:e2733f504d9e |
child | 9395:794eda565c69 |
comparison
equal
deleted
inserted
replaced
9393:e2733f504d9e | 9394:bcd94cc355d3 |
---|---|
33 -- Resolve DNS to target list | 33 -- Resolve DNS to target list |
34 local dns_resolver = adns.resolver(); | 34 local dns_resolver = adns.resolver(); |
35 dns_resolver:lookup(function (answer) | 35 dns_resolver:lookup(function (answer) |
36 if answer then | 36 if answer then |
37 if #answer == 0 then | 37 if #answer == 0 then |
38 if self.extra and self.extra.default_port then | |
39 table.insert(targets, { self.domain, self.extra.default_port, self.conn_type, self.extra }); | |
40 end | |
38 ready(); | 41 ready(); |
39 return; | 42 return; |
40 end | 43 end |
41 | 44 |
42 if #answer == 1 and answer[1].srv.target == "." then -- No service here | 45 if #answer == 1 and answer[1].srv.target == "." then -- No service here |