Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 4873:19e69cea6146
mod_s2s: Only try next target if the stream didn't open
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sun, 13 May 2012 16:03:05 +0100 |
parent | 4849:ea44fad88715 |
child | 4906:89df1f03546a |
comparison
equal
deleted
inserted
replaced
4872:b2059452fb55 | 4873:19e69cea6146 |
---|---|
290 (session.log or log)("debug", "Received </stream:stream>"); | 290 (session.log or log)("debug", "Received </stream:stream>"); |
291 session:close(); | 291 session:close(); |
292 end | 292 end |
293 | 293 |
294 function stream_callbacks.streamdisconnected(session, err) | 294 function stream_callbacks.streamdisconnected(session, err) |
295 if err and err ~= "closed" and session.direction == "outgoing" then | 295 if err and err ~= "closed" and session.direction == "outgoing" and session.notopen then |
296 (session.log or log)("debug", "s2s connection attempt failed: %s", err); | 296 (session.log or log)("debug", "s2s connection attempt failed: %s", err); |
297 if s2sout.attempt_connection(session, err) then | 297 if s2sout.attempt_connection(session, err) then |
298 (session.log or log)("debug", "...so we're going to try another target"); | 298 (session.log or log)("debug", "...so we're going to try another target"); |
299 return true; -- Session lives for now | 299 return true; -- Session lives for now |
300 end | 300 end |