Comparison

core/s2smanager.lua @ 2382:5e37e28a429f

s2smanager: Give reasons to destroy_session in more cases, including when DNS lookup fails
author Matthew Wild <mwild1@gmail.com>
date Thu, 17 Dec 2009 21:50:02 +0000
parent 2381:7926f513816b
child 2419:00d985639a06
comparison
equal deleted inserted replaced
2381:7926f513816b 2382:5e37e28a429f
222 -- Try with SRV, or just the plain hostname if no SRV 222 -- Try with SRV, or just the plain hostname if no SRV
223 local ok, err = try_connect(host_session, connect_host, connect_port); 223 local ok, err = try_connect(host_session, connect_host, connect_port);
224 if not ok then 224 if not ok then
225 if not attempt_connection(host_session, err) then 225 if not attempt_connection(host_session, err) then
226 -- No more attempts will be made 226 -- No more attempts will be made
227 destroy_session(host_session); 227 destroy_session(host_session, err);
228 end 228 end
229 end 229 end
230 end, "_xmpp-server._tcp."..connect_host..".", "SRV"); 230 end, "_xmpp-server._tcp."..connect_host..".", "SRV");
231 231
232 -- Set handler for DNS timeout 232 -- Set handler for DNS timeout
282 return make_connect(host_session, reply[#reply].a, connect_port); 282 return make_connect(host_session, reply[#reply].a, connect_port);
283 else 283 else
284 log("debug", "DNS lookup failed to get a response for %s", connect_host); 284 log("debug", "DNS lookup failed to get a response for %s", connect_host);
285 if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can 285 if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can
286 log("debug", "No other records to try for %s - destroying", host_session.to_host); 286 log("debug", "No other records to try for %s - destroying", host_session.to_host);
287 destroy_session(host_session); -- End of the line, we can't 287 destroy_session(host_session, "DNS resolution failed"); -- End of the line, we can't
288 end 288 end
289 end 289 end
290 end, connect_host, "A", "IN"); 290 end, connect_host, "A", "IN");
291 291
292 -- Set handler for DNS timeout 292 -- Set handler for DNS timeout