Mercurial > prosody-hg
comparison core/s2smanager.lua @ 3488:4f3fc5f9d944
s2smanager: Fire s2s{in,out}-destroyed when s2s connections are destroyed
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Sun, 05 Sep 2010 12:13:49 +0100 |
| parents | 193bb0936a4e |
| children | 1b76d18e8045 |
comparison
equal
deleted
inserted
replaced
| 3487:b5c92275910b | 3488:4f3fc5f9d944 |
|---|---|
| 574 bounce_sendq(session, reason); | 574 bounce_sendq(session, reason); |
| 575 elseif session.direction == "incoming" then | 575 elseif session.direction == "incoming" then |
| 576 incoming_s2s[session] = nil; | 576 incoming_s2s[session] = nil; |
| 577 end | 577 end |
| 578 | 578 |
| 579 local event_data = { session = session, reason = reason }; | |
| 580 if session.type == "s2sout" then | |
| 581 prosody.events.fire_event("s2sout-destroyed", event_data); | |
| 582 if hosts[session.from_host] then | |
| 583 hosts[session.from_host].events.fire_event("s2sout-destroyed", event_data); | |
| 584 end | |
| 585 else | |
| 586 prosody.events.fire_event("s2sin-destroyed", event_data); | |
| 587 if hosts[session.to_host] then | |
| 588 hosts[session.to_host].events.fire_event("s2sin-destroyed", event_data); | |
| 589 end | |
| 590 end | |
| 591 | |
| 579 retire_session(session); -- Clean session until it is GC'd | 592 retire_session(session); -- Clean session until it is GC'd |
| 580 end | 593 end |
| 581 | 594 |
| 582 return _M; | 595 return _M; |
