Diff

mod_s2s_keepalive/mod_s2s_keepalive.lua @ 3772:22f02716819f

mod_s2s_keepalive: Isolate source host of pings The incoming_s2s table is not restricted to the current virtualhost so this prevents opening more connections than what's needed. Also prevents useless double sending of one whitespace per local host.
author Kim Alvefur <zash@zash.se>
date Mon, 23 Dec 2019 01:18:02 +0100
parent 3771:98e1e3ce307d
child 3833:580862decd77
line wrap: on
line diff
--- a/mod_s2s_keepalive/mod_s2s_keepalive.lua	Mon Dec 23 01:12:10 2019 +0100
+++ b/mod_s2s_keepalive/mod_s2s_keepalive.lua	Mon Dec 23 01:18:02 2019 +0100
@@ -22,6 +22,7 @@
 
 	for session in pairs(prosody.incoming_s2s) do
 		if session.type ~= "s2sin_unauthed"
+		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
 			session.sends2s " ";