Software /
code /
prosody
Comparison
core/s2smanager.lua @ 4028:f596e1a5e88a
s2smanager: Destroy session on immediate failure of a connection attempt (e.g. inability to create sockets)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 24 Dec 2010 04:58:09 +0000 |
parent | 4027:81d0ed5787f6 |
child | 4078:05a58497a903 |
child | 4106:e19fc274e182 |
comparison
equal
deleted
inserted
replaced
4027:81d0ed5787f6 | 4028:f596e1a5e88a |
---|---|
303 end | 303 end |
304 -- end of CNAME resolving | 304 -- end of CNAME resolving |
305 | 305 |
306 if reply and reply[#reply] and reply[#reply].a then | 306 if reply and reply[#reply] and reply[#reply].a then |
307 log("debug", "DNS reply for %s gives us %s", connect_host, reply[#reply].a); | 307 log("debug", "DNS reply for %s gives us %s", connect_host, reply[#reply].a); |
308 return make_connect(host_session, reply[#reply].a, connect_port); | 308 local ok, err = make_connect(host_session, reply[#reply].a, connect_port); |
309 if not ok then | |
310 if not attempt_connection(host_session, err or "closed") then | |
311 err = err and (": "..err) or ""; | |
312 destroy_session(host_session, "Connection failed"..err); | |
313 end | |
314 end | |
309 else | 315 else |
310 log("debug", "DNS lookup failed to get a response for %s", connect_host); | 316 log("debug", "DNS lookup failed to get a response for %s", connect_host); |
311 if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can | 317 if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can |
312 log("debug", "No other records to try for %s - destroying", host_session.to_host); | 318 log("debug", "No other records to try for %s - destroying", host_session.to_host); |
313 err = err and (": "..err) or ""; | 319 err = err and (": "..err) or ""; |