aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-01-19 19:58:02 +0000
committerMatthew Wild <mwild1@gmail.com>2010-01-19 19:58:02 +0000
commit952317223de15d00d194c4820375854c626262ae (patch)
treefdaf819f06bd5c5b83508e85b025b5c7114f3648
parent9fee99dbb900c237ef082c073aa5945a64ba6f95 (diff)
downloadprosody-952317223de15d00d194c4820375854c626262ae.tar.gz
prosody-952317223de15d00d194c4820375854c626262ae.zip
s2smanager: Log error and fail gracefully if we can't open a socket for an outgoing s2s connection (thanks foucault)
-rw-r--r--core/s2smanager.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index a24f2b2d..98203a7d 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -308,6 +308,11 @@ function make_connect(host_session, connect_host, connect_port)
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);