Software /
code /
prosody
Comparison
plugins/mod_s2s/mod_s2s.lua @ 7638:a23b5cb8c22b
mod_s2s: Fire event when s2s connection fails
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 27 Aug 2016 13:40:10 +0100 |
parent | 7537:a0813737c6fa |
child | 7639:eab307f7435c |
child | 7642:2dcb402c4a0d |
comparison
equal
deleted
inserted
replaced
7635:6879a220917b | 7638:a23b5cb8c22b |
---|---|
632 if err and session.direction == "outgoing" and session.notopen then | 632 if err and session.direction == "outgoing" and session.notopen then |
633 (session.log or log)("debug", "s2s connection attempt failed: %s", err); | 633 (session.log or log)("debug", "s2s connection attempt failed: %s", err); |
634 if s2sout.attempt_connection(session, err) then | 634 if s2sout.attempt_connection(session, err) then |
635 return; -- Session lives for now | 635 return; -- Session lives for now |
636 end | 636 end |
637 hosts[session.from_host].events.fire_event("s2s-connect-failure", { session = session, err = err }); | |
637 end | 638 end |
638 (session.log or log)("debug", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "connection closed")); | 639 (session.log or log)("debug", "s2s disconnected: %s->%s (%s)", tostring(session.from_host), tostring(session.to_host), tostring(err or "connection closed")); |
639 s2s_destroy_session(session, err); | 640 s2s_destroy_session(session, err); |
640 end | 641 end |
641 end | 642 end |