From 9502dc7be9248d9d7c9d1ef5ad3dd2f26d748e70 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 c7b950e2..8fa97c49 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -190,7 +190,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