# HG changeset patch # User Kim Alvefur # Date 1577059930 -3600 # Node ID 98e1e3ce307de4d70ae254969a9df0a9c1dc9095 # Parent ae34ee0867f04945195efe62bdf8fa4a8d7c53c7 mod_s2s_keepalive: Invert check to work with bidi connections When mod_s2s_bidi is active there may be s2sin connections in the s2sout map, which made this not work correctly. diff -r ae34ee0867f0 -r 98e1e3ce307d mod_s2s_keepalive/mod_s2s_keepalive.lua --- a/mod_s2s_keepalive/mod_s2s_keepalive.lua Sun Dec 22 15:49:41 2019 +0100 +++ b/mod_s2s_keepalive/mod_s2s_keepalive.lua Mon Dec 23 01:12:10 2019 +0100 @@ -12,7 +12,7 @@ local ping_hosts = {}; for remote_domain, session in pairs(s2sout) do - if session.type == "s2sout" -- as opposed to _unauthed + if session.type ~= "s2sout_unauthed" and (not(keepalive_servers) or keepalive_servers:contains(remote_domain)) then session.sends2s(st.iq({ to = remote_domain, type = "get", from = host, id = "keepalive" }) :tag("ping", { xmlns = "urn:xmpp:ping" }) @@ -21,7 +21,7 @@ end for session in pairs(prosody.incoming_s2s) do - if session.type == "s2sin" -- as opposed to _unauthed + if session.type ~= "s2sin_unauthed" 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 " ";