mod_s2s_keepalive: Don't send whitespace keepalives before s2sin stream is open
authorKim Alvefur <zash@zash.se>
Thu, 10 Dec 2020 11:57:03 +0100
changeset 4297 edde5905744a
parent 4296 c13b8003ee5c
child 4298 ae8191d9d533
mod_s2s_keepalive: Don't send whitespace keepalives before s2sin stream is open Could possibly result in whitespace before the XML and stream header, which isn't allowed by the parser. Don't think s2sout is affected, as the stream is opened early and doesn't have to wait for the other end. Thanks Ge0rG
mod_s2s_keepalive/mod_s2s_keepalive.lua
--- a/mod_s2s_keepalive/mod_s2s_keepalive.lua	Wed Dec 09 22:32:31 2020 +0000
+++ b/mod_s2s_keepalive/mod_s2s_keepalive.lua	Thu Dec 10 11:57:03 2020 +0100
@@ -23,6 +23,7 @@
 
 	for session in pairs(prosody.incoming_s2s) do
 		if session.type ~= "s2sin_unauthed"
+		and not session.notopen
 		and session.to_host == host
 		and (not(keepalive_servers) or keepalive_servers:contains(session.from_host)) then
 			if not s2sout[session.from_host] then ping_hosts[session.from_host] = true; end