Changeset

2422:affeb565b050

s2smanager: Allow new_outgoing() to create sessions without automatically connecting them (set 3rd parameters to false)
author Matthew Wild <mwild1@gmail.com>
date Mon, 04 Jan 2010 17:32:26 +0000
parents 2421:83773aed9437
children 2423:0597c553acf2
files core/s2smanager.lua
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/s2smanager.lua	Sun Jan 03 11:26:36 2010 -0800
+++ b/core/s2smanager.lua	Mon Jan 04 17:32:26 2010 +0000
@@ -148,7 +148,7 @@
 	return session;
 end
 
-function new_outgoing(from_host, to_host)
+function new_outgoing(from_host, to_host, connect)
 		local host_session = { to_host = to_host, from_host = from_host, host = from_host,
 		                       notopen = true, type = "s2sout_unauthed", direction = "outgoing" };
 		
@@ -161,8 +161,10 @@
 			host_session.log = log;
 		end
 		
-		-- Kick the connection attempting machine
-		attempt_connection(host_session);
+		if connect ~= false then
+			-- Kick the connection attempting machine into life
+			attempt_connection(host_session);
+		end
 		
 		if not host_session.sends2s then
 			-- A sends2s which buffers data (until the stream is opened)