From 0f27eda0d6c669de07363fdbb50648b5749b2a21 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 24 Dec 2010 04:56:37 +0000 Subject: s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly --- core/s2smanager.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'core') 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 -- cgit v1.2.3