# HG changeset patch # User Kim Alvefur # Date 1626875833 -7200 # Node ID 0e60ce83205cd19f5328450ac2bc13dfabd5396d # Parent 15c4eabdcea03f4d429790f01f8180b32ec16f24 mod_s2s_keepalive: Ignore errors from the local server If a stanza can't be delivered and instead an bounce is generated, the origin of the error, when different from the stanza 'from' should be indicated in the 'by' attribute of the , which we look for here so this doesn't count as a successful ping. An error that does come from the remote means we have connectivity, but probably no XEP-0199 handling. This is fine. We care about connectivity, not protocol. diff -r 15c4eabdcea0 -r 0e60ce83205c mod_s2s_keepalive/mod_s2s_keepalive.lua --- a/mod_s2s_keepalive/mod_s2s_keepalive.lua Wed Jul 21 15:52:12 2021 +0200 +++ b/mod_s2s_keepalive/mod_s2s_keepalive.lua Wed Jul 21 15:57:13 2021 +0200 @@ -70,6 +70,13 @@ if not (stanza.attr.id and stanza.attr.id:sub(1, #"keepalive:") == "keepalive:") then return -- not a reply to this module end + if stanza.attr.type == "error" then + local err = stanza:get_child("error"); + local err_by = err and err.attr.by; + if err_by and prosody.hosts[err_by] then + return -- error produced by the local host + end + end local origin = event.origin; if origin.dummy then return end -- Probably a sendq bounce