Mercurial > prosody-hg
comparison net/resolvers/basic.lua @ 14107:bc33a7269f5a
net.resolvers.basic: Start AAAA lookup before A lookup per RFC 8305
> Both queries SHOULD be made as soon after one another as possible,
> with the AAAA query made first and immediately followed by the A
> query.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 12 Mar 2026 16:16:57 +0100 |
| parents | cc406878209d |
| children | 59064f0f8b4e |
comparison
equal
deleted
inserted
replaced
| 14106:b5eeb6730721 | 14107:bc33a7269f5a |
|---|---|
| 81 | 81 |
| 82 -- Resolve DNS to target list | 82 -- Resolve DNS to target list |
| 83 local dns_resolver = adns.resolver(); | 83 local dns_resolver = adns.resolver(); |
| 84 | 84 |
| 85 local dns_lookups = { | 85 local dns_lookups = { |
| 86 ipv6 = do_dns_lookup(self, dns_resolver, "AAAA", self.hostname, true); | |
| 86 ipv4 = do_dns_lookup(self, dns_resolver, "A", self.hostname, true); | 87 ipv4 = do_dns_lookup(self, dns_resolver, "A", self.hostname, true); |
| 87 ipv6 = do_dns_lookup(self, dns_resolver, "AAAA", self.hostname, true); | |
| 88 tlsa = do_dns_lookup(self, dns_resolver, "TLSA", ("_%d._%s.%s"):format(self.port, self.conn_type, self.hostname)); | 88 tlsa = do_dns_lookup(self, dns_resolver, "TLSA", ("_%d._%s.%s"):format(self.port, self.conn_type, self.hostname)); |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 promise.all_settled(dns_lookups):next(function (dns_results) | 91 promise.all_settled(dns_lookups):next(function (dns_results) |
| 92 -- Combine targets, assign to self.targets, self:next(cb) | 92 -- Combine targets, assign to self.targets, self:next(cb) |
