Software / code / prosody
Comparison
plugins/mod_s2s.lua @ 12680:ca4abc6ab208
Merge 0.12->trunk
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 26 Aug 2022 19:03:23 +0200 |
| parent | 12602:9184fe3d489a |
| parent | 12679:7d4a95ba9b6c |
| child | 12681:16ea01745dbe |
comparison
equal
deleted
inserted
replaced
| 12678:5a61e1603f42 | 12680:ca4abc6ab208 |
|---|---|
| 458 session:close({ condition = "improper-addressing", text = "New stream 'from' attribute does not match original" }); | 458 session:close({ condition = "improper-addressing", text = "New stream 'from' attribute does not match original" }); |
| 459 return; | 459 return; |
| 460 end | 460 end |
| 461 if session.type == "s2sin_unauthed" and to and not session.to_host then | 461 if session.type == "s2sin_unauthed" and to and not session.to_host then |
| 462 session.to_host = to; | 462 session.to_host = to; |
| 463 session.host = to; | |
| 463 elseif to ~= session.to_host then | 464 elseif to ~= session.to_host then |
| 464 session:close({ condition = "improper-addressing", text = "New stream 'to' attribute does not match original" }); | 465 session:close({ condition = "improper-addressing", text = "New stream 'to' attribute does not match original" }); |
| 465 return; | 466 return; |
| 466 end | 467 end |
| 467 | 468 |
| 883 end | 884 end |
| 884 | 885 |
| 885 function listener.onreadtimeout(conn) | 886 function listener.onreadtimeout(conn) |
| 886 local session = sessions[conn]; | 887 local session = sessions[conn]; |
| 887 if session then | 888 if session then |
| 888 local host = session.host or session.to_host; | 889 return (hosts[session.host] or prosody).events.fire_event("s2s-read-timeout", { session = session }); |
| 889 return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session }); | |
| 890 end | 890 end |
| 891 end | 891 end |
| 892 | 892 |
| 893 function listener.ondrain(conn) | 893 function listener.ondrain(conn) |
| 894 local session = sessions[conn]; | 894 local session = sessions[conn]; |