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 | 9502dc7be9248d9d7c9d1ef5ad3dd2f26d748e70 (patch) | |
tree | 6169b0f6314e3b782d80ee06523de04287c2bf66 /core/s2smanager.lua | |
parent | b1a22d59e455f22151650c88d622ee3a2710a9ca (diff) | |
download | prosody-9502dc7be9248d9d7c9d1ef5ad3dd2f26d748e70.tar.gz prosody-9502dc7be9248d9d7c9d1ef5ad3dd2f26d748e70.zip |
s2smanager: new_outgoing(): Destroy session if first connection attempt fails immediately (e.g. can't create sockets)
Diffstat (limited to 'core/s2smanager.lua')
-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 c7b950e2..8fa97c49 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -190,7 +190,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 |