Mercurial > prosody-hg
comparison plugins/mod_s2s.lua @ 14027:4a288b082f42 13.0
mod_s2s: Fix traceback when outgoing s2s queue is full (thanks tom)
When session.send() is used, no 'origin' field is included in the event,
leading to an error attempting to index nil.
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 04 Jan 2026 17:54:48 +0100 |
| parents | cbb8dc92daa9 |
| children | 04d7f2038933 |
comparison
equal
deleted
inserted
replaced
| 14026:8a9c1bc37ebc | 14027:4a288b082f42 |
|---|---|
| 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 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")); |
| 205 return true; | 206 return true; |
| 206 end | 207 end |
| 207 host.log("debug", "stanza [%s] queued ", stanza.name); | 208 host.log("debug", "stanza [%s] queued ", stanza.name); |
| 208 return true; | 209 return true; |
