Software /
code /
prosody
Comparison
core/s2smanager.lua @ 3958:8bd0b2d4b9b0
s2smanager: send_to_host(): Handle already-destroyed session and bounce stanza accordingly
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 24 Dec 2010 04:56:37 +0000 |
parent | 3957:b5223a74e07e |
child | 3959:32a2a4f522f8 |
comparison
equal
deleted
inserted
replaced
3957:b5223a74e07e | 3958:8bd0b2d4b9b0 |
---|---|
124 -- Store in buffer | 124 -- Store in buffer |
125 host_session.sendq = { {tostring(data), st.reply(data)} }; | 125 host_session.sendq = { {tostring(data), st.reply(data)} }; |
126 log("debug", "stanza [%s] queued until connection complete", tostring(data.name)); | 126 log("debug", "stanza [%s] queued until connection complete", tostring(data.name)); |
127 if (not host_session.connecting) and (not host_session.conn) then | 127 if (not host_session.connecting) and (not host_session.conn) then |
128 log("warn", "Connection to %s failed already, destroying session...", to_host); | 128 log("warn", "Connection to %s failed already, destroying session...", to_host); |
129 destroy_session(host_session); | 129 if not destroy_session(host_session, "Connection failed") then |
130 -- Already destroyed, we need to bounce our stanza | |
131 bounce_sendq(host_session, host_session.destruction_reason); | |
132 end | |
130 return false; | 133 return false; |
131 end | 134 end |
132 end | 135 end |
133 return true; | 136 return true; |
134 end | 137 end |