aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);