aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2022-08-26 18:53:00 +0200
committerKim Alvefur <zash@zash.se>2022-08-26 18:53:00 +0200
commite38e915ef50ec62f1724ef55018b6b4120988a0d (patch)
tree2601d88232eac2dab732a34884e71facce4a7cc6 /plugins
parentee21d9480a7b168cc7971f4ef3d3879b3b045bd1 (diff)
downloadprosody-e38e915ef50ec62f1724ef55018b6b4120988a0d.tar.gz
prosody-e38e915ef50ec62f1724ef55018b6b4120988a0d.zip
mod_s2s: Fix firing buffer drain events
Fixes the same kind of issue as in 65563530375b but once and for all, while improving similarity between incoming and outgoing connections.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua
index e810c6cd..300a747e 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -464,6 +464,7 @@ function stream_callbacks._streamopened(session, attr)
end
if session.type == "s2sin_unauthed" and to and not session.to_host then
session.to_host = to;
+ session.host = to;
elseif to ~= session.to_host then
session:close({ condition = "improper-addressing", text = "New stream 'to' attribute does not match original" });
return;
@@ -888,8 +889,7 @@ end
function listener.onreadtimeout(conn)
local session = sessions[conn];
if session then
- local host = session.host or session.to_host;
- return (hosts[host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
+ return (hosts[session.host] or prosody).events.fire_event("s2s-read-timeout", { session = session });
end
end