# HG changeset patch # User Matthew Wild # Date 1293166689 0 # Node ID f596e1a5e88a59c9e39ca5e40664194647b39e7a # Parent 81d0ed5787f6ffbf92a72751583a260cf8fb06ee s2smanager: Destroy session on immediate failure of a connection attempt (e.g. inability to create sockets) diff -r 81d0ed5787f6 -r f596e1a5e88a core/s2smanager.lua --- a/core/s2smanager.lua Fri Dec 24 04:57:17 2010 +0000 +++ b/core/s2smanager.lua Fri Dec 24 04:58:09 2010 +0000 @@ -305,7 +305,13 @@ if reply and reply[#reply] and reply[#reply].a then log("debug", "DNS reply for %s gives us %s", connect_host, reply[#reply].a); - return make_connect(host_session, reply[#reply].a, connect_port); + local ok, err = make_connect(host_session, reply[#reply].a, connect_port); + if not ok then + if not attempt_connection(host_session, err or "closed") then + err = err and (": "..err) or ""; + destroy_session(host_session, "Connection failed"..err); + end + end else log("debug", "DNS lookup failed to get a response for %s", connect_host); if not attempt_connection(host_session, "name resolution failed") then -- Retry if we can