aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-02-25 17:53:27 +0000
committerMatthew Wild <mwild1@gmail.com>2010-02-25 17:53:27 +0000
commitf713f780454c2a67e67d316447ad9a5da88e5731 (patch)
tree5db3682f71fcb3116b1f4ad73ad14d1ce2190494 /core/s2smanager.lua
parent1ac7b7a3b7659d52221e382e32b5eec18722e27a (diff)
downloadprosody-f713f780454c2a67e67d316447ad9a5da88e5731.tar.gz
prosody-f713f780454c2a67e67d316447ad9a5da88e5731.zip
s2smanager: Log and fail gracefully when unable to create socket for outgoing s2s connection (thanks foucault)
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index e37cac73..bfa3069a 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -306,6 +306,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);