aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-12-24 04:56:37 +0000
committerMatthew Wild <mwild1@gmail.com>2010-12-24 04:56:37 +0000
commit1f94e008896068e42f26f933fd5cf10cfc74f546 (patch)
treef96955e42fea76ed4eff1bd7b5e878fa70d07dcf /core
parentf6844e23d7f5c41c199b9097ad4b9b49616f3749 (diff)
downloadprosody-1f94e008896068e42f26f933fd5cf10cfc74f546.tar.gz
prosody-1f94e008896068e42f26f933fd5cf10cfc74f546.zip
s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua5
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