aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
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
commite34e79a6c056481cf75c084d081adfd8f5fe0c04 (patch)
tree4404e45010daa40eedf3bc7d828d81c64da9f803 /plugins/mod_s2s
parent5adb3ba2dc673b8195425bfa6035a6dc0a1d9920 (diff)
downloadprosody-e34e79a6c056481cf75c084d081adfd8f5fe0c04.tar.gz
prosody-e34e79a6c056481cf75c084d081adfd8f5fe0c04.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
Diffstat (limited to 'plugins/mod_s2s')
-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);