Software / code / prosody
Comparison
plugins/mod_s2s/s2sout.lib.lua @ 6633:832987170da8
Merge 0.10->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 26 Apr 2015 00:07:36 +0200 |
| parent | 6632:855085439f7f |
| child | 6685:3f05b255937f |
comparison
equal
deleted
inserted
replaced
| 6626:071611bc4f1d | 6633:832987170da8 |
|---|---|
| 166 local have_other_result = not(has_ipv4) or not(has_ipv6) or false; | 166 local have_other_result = not(has_ipv4) or not(has_ipv6) or false; |
| 167 | 167 |
| 168 if has_ipv4 then | 168 if has_ipv4 then |
| 169 handle4 = adns.lookup(function (reply, err) | 169 handle4 = adns.lookup(function (reply, err) |
| 170 handle4 = nil; | 170 handle4 = nil; |
| 171 | |
| 172 -- COMPAT: This is a compromise for all you CNAME-(ab)users :) | |
| 173 if not (reply and reply[#reply] and reply[#reply].a) then | |
| 174 local count = max_dns_depth; | |
| 175 reply = dns.peek(connect_host, "CNAME", "IN"); | |
| 176 while count > 0 and reply and reply[#reply] and not reply[#reply].a and reply[#reply].cname do | |
| 177 log("debug", "Looking up %s (DNS depth is %d)", tostring(reply[#reply].cname), count); | |
| 178 reply = dns.peek(reply[#reply].cname, "A", "IN") or dns.peek(reply[#reply].cname, "CNAME", "IN"); | |
| 179 count = count - 1; | |
| 180 end | |
| 181 end | |
| 182 -- end of CNAME resolving | |
| 183 | 171 |
| 184 if reply and reply[#reply] and reply[#reply].a then | 172 if reply and reply[#reply] and reply[#reply].a then |
| 185 for _, ip in ipairs(reply) do | 173 for _, ip in ipairs(reply) do |
| 186 log("debug", "DNS reply for %s gives us %s", connect_host, ip.a); | 174 log("debug", "DNS reply for %s gives us %s", connect_host, ip.a); |
| 187 IPs[#IPs+1] = new_ip(ip.a, "IPv4"); | 175 IPs[#IPs+1] = new_ip(ip.a, "IPv4"); |