comparison plugins/mod_s2s.lua @ 14028:04d7f2038933 13.0

mod_s2s: Explicitly prevent sending recursive error replies when queue is full
author Kim Alvefur <zash@zash.se>
date Sun, 04 Jan 2026 17:58:26 +0100
parents 4a288b082f42
children e08e535a9945 a1fb05cbd44e
comparison
equal deleted inserted replaced
14027:4a288b082f42 14028:04d7f2038933
199 -- luacheck: ignore 122 199 -- luacheck: ignore 122
200 host.sendq = queue.new(sendq_size); 200 host.sendq = queue.new(sendq_size);
201 end 201 end
202 if not host.sendq:push(st.clone(stanza)) then 202 if not host.sendq:push(st.clone(stanza)) then
203 host.log("warn", "stanza [%s] not queued ", stanza.name); 203 host.log("warn", "stanza [%s] not queued ", stanza.name);
204 if not event.origin then return false; end 204 if not event.origin or stanza.attr.type == "error" or stanza.attr.type == "result" then return false; end
205 event.origin.send(st.error_reply(stanza, "wait", "resource-constraint", "Outgoing stanza queue full")); 205 event.origin.send(st.error_reply(stanza, "wait", "resource-constraint", "Outgoing stanza queue full"));
206 return true; 206 return true;
207 end 207 end
208 host.log("debug", "stanza [%s] queued ", stanza.name); 208 host.log("debug", "stanza [%s] queued ", stanza.name);
209 return true; 209 return true;