Mercurial > prosody-hg
comparison core/s2smanager.lua @ 4017:2cb5bb26b831
s2smanager: session.send(): Return the result of send_to_host() (and incidentally make this a tail call \o/)
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 22 Dec 2010 20:39:30 +0000 |
| parents | 0e927d4644c3 |
| children | 5061c8d41d89 |
comparison
equal
deleted
inserted
replaced
| 4016:0e927d4644c3 | 4017:2cb5bb26b831 |
|---|---|
| 516 local from, to = session.from_host, session.to_host; | 516 local from, to = session.from_host, session.to_host; |
| 517 | 517 |
| 518 session.log("info", session.direction.." s2s connection "..from.."->"..to.." complete"); | 518 session.log("info", session.direction.." s2s connection "..from.."->"..to.." complete"); |
| 519 | 519 |
| 520 local send_to_host = send_to_host; | 520 local send_to_host = send_to_host; |
| 521 function session.send(data) send_to_host(to, from, data); end | 521 function session.send(data) return send_to_host(to, from, data); end |
| 522 | 522 |
| 523 local event_data = { session = session }; | 523 local event_data = { session = session }; |
| 524 if session.type == "s2sout" then | 524 if session.type == "s2sout" then |
| 525 prosody.events.fire_event("s2sout-established", event_data); | 525 prosody.events.fire_event("s2sout-established", event_data); |
| 526 hosts[session.from_host].events.fire_event("s2sout-established", event_data); | 526 hosts[session.from_host].events.fire_event("s2sout-established", event_data); |
