# HG changeset patch # User Matthew Wild # Date 1293166597 0 # Node ID 21edd42768b569e25fb3758cce3894278aaeee44 # Parent cc2e75e49cfbf4f5dfebf90eea2a6d4f1564fa18 s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly diff -r cc2e75e49cfb -r 21edd42768b5 core/s2smanager.lua --- a/core/s2smanager.lua Fri Dec 24 04:56:02 2010 +0000 +++ b/core/s2smanager.lua Fri Dec 24 04:56:37 2010 +0000 @@ -125,7 +125,10 @@ 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