From f6844e23d7f5c41c199b9097ad4b9b49616f3749 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 24 Dec 2010 04:56:02 +0000 Subject: s2smanager: new_outgoing(): Destroy session if first connection attempt fails immediately (e.g. can't create sockets) --- core/s2smanager.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 6f1c25d9..97b31363 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -191,7 +191,11 @@ function new_outgoing(from_host, to_host, connect) if connect ~= false then -- Kick the connection attempting machine into life - attempt_connection(host_session); + if not attempt_connection(host_session) then + -- Intentionally not returning here, the + -- session is needed, connected or not + destroy_session(host_session); + end end if not host_session.sends2s then -- cgit v1.2.3