diff options
author | Kim Alvefur <zash@zash.se> | 2020-12-10 11:53:10 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2020-12-10 11:53:10 +0100 |
commit | f4c821cc4ae1cd57fe88b5e579ee447ece44cdb4 (patch) | |
tree | 4404e45010daa40eedf3bc7d828d81c64da9f803 /plugins/mod_s2s/mod_s2s.lua | |
parent | 15b64ea4ff015baaac85cd2438cae3ab0a42cb19 (diff) | |
download | prosody-f4c821cc4ae1cd57fe88b5e579ee447ece44cdb4.tar.gz prosody-f4c821cc4ae1cd57fe88b5e579ee447ece44cdb4.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/mod_s2s.lua')
-rw-r--r-- | plugins/mod_s2s/mod_s2s.lua | 5 |
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); |