Software /
code /
prosody
Comparison
plugins/mod_s2s.lua @ 12807:f0f7b0c61465
mod_s2s: Avoid sending too large stanzas
Just dropping them isn't great but hopefully something more sensible can
be done in the future.
Will need work to ensure that this signal is handled correctly in
sending modules etc.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 16 Mar 2021 18:30:54 +0100 |
parent | 12806:751bdd412915 |
child | 12808:12bd40b8e105 |
comparison
equal
deleted
inserted
replaced
12806:751bdd412915 | 12807:f0f7b0c61465 |
---|---|
770 if t.name then | 770 if t.name then |
771 t = filter("stanzas/out", t); | 771 t = filter("stanzas/out", t); |
772 end | 772 end |
773 if t then | 773 if t then |
774 t = filter("bytes/out", tostring(t)); | 774 t = filter("bytes/out", tostring(t)); |
775 if session.outgoing_stanza_size_limit and #t > session.outgoing_stanza_size_limit then | |
776 log("warn", "Attempt to send a stanza exceeding session limit of %dB (%dB)!", session.outgoing_stanza_size_limit, #t); | |
777 -- TODO Pass identifiable error condition back to allow appropriate handling | |
778 return false | |
779 end | |
775 if t then | 780 if t then |
776 return w(conn, t); | 781 return w(conn, t); |
777 end | 782 end |
778 end | 783 end |
779 end | 784 end |