s2smanager: new_outgoing(): Destroy session if first connection attempt fails immediately (e.g. can't create sockets)

Fri, 24 Dec 2010 04:56:02 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Fri, 24 Dec 2010 04:56:02 +0000
changeset 3957
b5223a74e07e
parent 3956
32ec833c2edf
child 3958
8bd0b2d4b9b0

s2smanager: new_outgoing(): Destroy session if first connection attempt fails immediately (e.g. can't create sockets)

core/s2smanager.lua file | annotate | diff | comparison | revisions
--- a/core/s2smanager.lua	Fri Dec 24 04:52:40 2010 +0000
+++ b/core/s2smanager.lua	Fri Dec 24 04:56:02 2010 +0000
@@ -191,7 +191,11 @@
 		
 		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

mercurial