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 | 1f94e008896068e42f26f933fd5cf10cfc74f546 (patch) | |
tree | f96955e42fea76ed4eff1bd7b5e878fa70d07dcf | |
parent | f6844e23d7f5c41c199b9097ad4b9b49616f3749 (diff) | |
download | prosody-1f94e008896068e42f26f933fd5cf10cfc74f546.tar.gz prosody-1f94e008896068e42f26f933fd5cf10cfc74f546.zip |
s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly
-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 97b31363..2f561070 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -126,7 +126,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 |