diff options
author | Matthew Wild <mwild1@gmail.com> | 2010-12-24 04:56:37 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2010-12-24 04:56:37 +0000 |
commit | 0f27eda0d6c669de07363fdbb50648b5749b2a21 (patch) | |
tree | a288f2063d053ca307bba748eba8ca9f6671afb3 /core | |
parent | 9502dc7be9248d9d7c9d1ef5ad3dd2f26d748e70 (diff) | |
download | prosody-0f27eda0d6c669de07363fdbb50648b5749b2a21.tar.gz prosody-0f27eda0d6c669de07363fdbb50648b5749b2a21.zip |
s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly
Diffstat (limited to 'core')
-rw-r--r-- | core/s2smanager.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 8fa97c49..cd381308 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -125,7 +125,10 @@ function send_to_host(from_host, to_host, data) log("debug", "stanza [%s] queued until connection complete", tostring(data.name)); if (not host_session.connecting) and (not host_session.conn) then log("warn", "Connection to %s failed already, destroying session...", to_host); - destroy_session(host_session); + if not destroy_session(host_session, "Connection failed") then + -- Already destroyed, we need to bounce our stanza + bounce_sendq(host_session, host_session.destruction_reason); + end return false; end end |