Changeset

3833:580862decd77

mod_s2s_keepalive: Respect keepalive_servers when creating watchdogs
author Kim Alvefur <zash@zash.se>
date Sat, 04 Jan 2020 11:09:28 +0100
parents 3832:0d4146cf9fbc
children 3834:2f189f022b84
files mod_s2s_keepalive/mod_s2s_keepalive.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_s2s_keepalive/mod_s2s_keepalive.lua	Fri Jan 03 18:29:10 2020 +0100
+++ b/mod_s2s_keepalive/mod_s2s_keepalive.lua	Sat Jan 04 11:09:28 2020 +0100
@@ -43,6 +43,7 @@
 module:hook("s2sin-established", function (event)
 	local session = event.session;
 	if session.watchdog_keepalive then return end -- in case mod_bidi fires this twice
+	if keepalive_servers and not keepalive_servers:contains(session.from_host) then return end
 	session.watchdog_keepalive = watchdog.new(keepalive_timeout, function ()
 		session.log("info", "Keepalive ping timed out, closing connection");
 		session:close("connection-timeout");
@@ -52,6 +53,7 @@
 module:hook("s2sout-established", function (event)
 	local session = event.session;
 	if session.watchdog_keepalive then return end -- in case mod_bidi fires this twice
+	if keepalive_servers and not keepalive_servers:contains(session.from_host) then return end
 	session.watchdog_keepalive = watchdog.new(keepalive_timeout, function ()
 		session.log("info", "Keepalive ping timed out, closing connection");
 		session:close("connection-timeout");