diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-12-24 04:56:02 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-12-24 04:56:02 +0000 |
commit | f6844e23d7f5c41c199b9097ad4b9b49616f3749 (patch) | |
tree | 71ad217e8542f342381f7d27eb91bf35dbcf6e18 | |
parent | f808601d103006b6e35c8ee1e21759b5c5e0744c (diff) | |
download | prosody-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.lua | 6 |
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 |