s2smanager: Log error and fail gracefully if we can't open a socket for an outgoing s2s connection (thanks foucault)

Tue, 19 Jan 2010 19:58:02 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 19 Jan 2010 19:58:02 +0000
changeset 2472
cde876604bb7
parent 2471
2aeb55a51f47
child 2473
3f4cfa375bd6

s2smanager: Log error and fail gracefully if we can't open a socket for an outgoing s2s connection (thanks foucault)

core/s2smanager.lua file | annotate | diff | comparison | revisions
--- a/core/s2smanager.lua	Tue Jan 19 04:38:43 2010 +0000
+++ b/core/s2smanager.lua	Tue Jan 19 19:58:02 2010 +0000
@@ -308,6 +308,11 @@
 	local from_host, to_host = host_session.from_host, host_session.to_host;
 	
 	local conn, handler = socket.tcp()
+	
+	if not conn then
+		log("warn", "Failed to create outgoing connection, system error: %s", handler);
+		return false, handler;
+	end
 
 	conn:settimeout(0);
 	local success, err = conn:connect(connect_host, connect_port);

mercurial