Comparison

plugins/mod_s2s/s2sout.lib.lua @ 5112:8b94a8d92cf3

mod_s2s: Check that an SRV reply isn't empty.
author Kim Alvefur <zash@zash.se>
date Mon, 03 Sep 2012 04:22:40 +0200
parent 4987:d37f2abac72c
child 5351:901ed253bbf7
comparison
equal deleted inserted replaced
5111:7e577727fb9f 5112:8b94a8d92cf3
92 host_session.connecting = true; 92 host_session.connecting = true;
93 local handle; 93 local handle;
94 handle = adns.lookup(function (answer) 94 handle = adns.lookup(function (answer)
95 handle = nil; 95 handle = nil;
96 host_session.connecting = nil; 96 host_session.connecting = nil;
97 if answer then 97 if answer and #answer > 0 then
98 log("debug", "%s has SRV records, handling...", to_host); 98 log("debug", "%s has SRV records, handling...", to_host);
99 local srv_hosts = {}; 99 local srv_hosts = {};
100 host_session.srv_hosts = srv_hosts; 100 host_session.srv_hosts = srv_hosts;
101 for _, record in ipairs(answer) do 101 for _, record in ipairs(answer) do
102 t_insert(srv_hosts, record.srv); 102 t_insert(srv_hosts, record.srv);