Software /
code /
prosody
Comparison
net/resolvers/service.lua @ 9393:e2733f504d9e
net.resolvers.service: Early return on empty result set
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 29 Sep 2018 22:02:36 +0200 |
parent | 9392:f2d71e4284b7 |
child | 9394:bcd94cc355d3 |
comparison
equal
deleted
inserted
replaced
9392:f2d71e4284b7 | 9393:e2733f504d9e |
---|---|
32 | 32 |
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 | |
38 ready(); | |
39 return; | |
40 end | |
41 | |
37 if #answer == 1 and answer[1].srv.target == "." then -- No service here | 42 if #answer == 1 and answer[1].srv.target == "." then -- No service here |
38 ready(); | 43 ready(); |
39 return; | 44 return; |
40 end | 45 end |
41 | 46 |