aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-12-10 11:53:10 +0100
committerKim Alvefur <zash@zash.se>2020-12-10 11:53:10 +0100
commit507554e6851783e1b38be0eff652df37b096c1ba (patch)
tree4404e45010daa40eedf3bc7d828d81c64da9f803
parentbc3187152988220b1b213a5cfd4b2b570667e735 (diff)
downloadprosody-507554e6851783e1b38be0eff652df37b096c1ba.tar.gz
prosody-507554e6851783e1b38be0eff652df37b096c1ba.zip
mod_s2s: Prevent whitespace keepalives the stream has been opened
This will result in the stream timing out instead, which is probably correct if the stream has not been opened yet. This was already done for c2s in e69df8093387 Thanks Ge0rG
-rw-r--r--plugins/mod_s2s/mod_s2s.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 5439aa96..4fce20eb 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -163,7 +163,10 @@ function route_to_new_session(event)
end
local function keepalive(event)
- return event.session.sends2s(' ');
+ local session = event.session;
+ if not session.notopen then
+ return event.session.send(' ');
+ end
end
module:hook("s2s-read-timeout", keepalive, -1);