aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-24 04:56:02 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-24 04:56:02 +0000
commitf6844e23d7f5c41c199b9097ad4b9b49616f3749 (patch)
tree71ad217e8542f342381f7d27eb91bf35dbcf6e18
parentf808601d103006b6e35c8ee1e21759b5c5e0744c (diff)
downloadprosody-f6844e23d7f5c41c199b9097ad4b9b49616f3749.tar.gz
prosody-f6844e23d7f5c41c199b9097ad4b9b49616f3749.zip
s2smanager: new_outgoing(): Destroy session if first connection attempt fails immediately (e.g. can't create sockets)
-rw-r--r--core/s2smanager.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 6f1c25d9..97b31363 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -191,7 +191,11 @@ function new_outgoing(from_host, to_host, connect)
if connect ~= false then
-- Kick the connection attempting machine into life
- attempt_connection(host_session);
+ if not attempt_connection(host_session) then
+ -- Intentionally not returning here, the
+ -- session is needed, connected or not
+ destroy_session(host_session);
+ end
end
if not host_session.sends2s then