Software /
code /
prosody
Comparison
plugins/s2s/mod_s2s.lua @ 4592:0a9528b178fd
mod_s2s: remove conn sessions clearing redundancy and leave it only in listener.ondisconnect
author | Marco Cirillo <maranda@lightwitch.org> |
---|---|
date | Mon, 05 Mar 2012 16:39:50 +0000 |
parent | 4589:8553d822f417 |
child | 4593:470f502f02a3 |
comparison
equal
deleted
inserted
replaced
4589:8553d822f417 | 4592:0a9528b178fd |
---|---|
278 (session.log or log)("debug", "...so we're going to try another target"); | 278 (session.log or log)("debug", "...so we're going to try another target"); |
279 return true; -- Session lives for now | 279 return true; -- Session lives for now |
280 end | 280 end |
281 end | 281 end |
282 (session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "closed")); | 282 (session.log or log)("info", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "closed")); |
283 sessions[session.conn] = nil; | |
284 s2s_destroy_session(session, err); | 283 s2s_destroy_session(session, err); |
285 end | 284 end |
286 | 285 |
287 function stream_callbacks.error(session, error, data) | 286 function stream_callbacks.error(session, error, data) |
288 if error == "no-stream" then | 287 if error == "no-stream" then |
455 if session then | 454 if session then |
456 if stream_callbacks.streamdisconnected(session, err) then | 455 if stream_callbacks.streamdisconnected(session, err) then |
457 return; -- Connection lives, for now | 456 return; -- Connection lives, for now |
458 end | 457 end |
459 end | 458 end |
460 sessions[conn] = nil; | 459 sessions[conn] = nil; |
461 end | 460 end |
462 | 461 |
463 function listener.register_outgoing(conn, session) | 462 function listener.register_outgoing(conn, session) |
464 session.direction = "outgoing"; | 463 session.direction = "outgoing"; |
465 sessions[conn] = session; | 464 sessions[conn] = session; |