Software / code / prosody
Comparison
plugins/s2s/mod_s2s.lua @ 4798:e8bd0a6f45e2
mod_s2s: Don't try to continue attempting to connect when an s2sin is closed
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 29 Apr 2012 02:24:00 +0200 |
| parent | 4783:21c513a89951 |
comparison
equal
deleted
inserted
replaced
| 4792:bf107d9d4962 | 4798:e8bd0a6f45e2 |
|---|---|
| 278 (session.log or log)("debug", "Received </stream:stream>"); | 278 (session.log or log)("debug", "Received </stream:stream>"); |
| 279 session:close(); | 279 session:close(); |
| 280 end | 280 end |
| 281 | 281 |
| 282 function stream_callbacks.streamdisconnected(session, err) | 282 function stream_callbacks.streamdisconnected(session, err) |
| 283 if err and err ~= "closed" then | 283 if err and err ~= "closed" and session.direction == "outgoing" then |
| 284 (session.log or log)("debug", "s2s connection attempt failed: %s", err); | 284 (session.log or log)("debug", "s2s connection attempt failed: %s", err); |
| 285 if s2sout.attempt_connection(session, err) then | 285 if s2sout.attempt_connection(session, err) then |
| 286 (session.log or log)("debug", "...so we're going to try another target"); | 286 (session.log or log)("debug", "...so we're going to try another target"); |
| 287 return true; -- Session lives for now | 287 return true; -- Session lives for now |
| 288 end | 288 end |