aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-16 18:30:34 +0100
committerKim Alvefur <zash@zash.se>2021-03-16 18:30:34 +0100
commit6d0298961d6d4150aa43897baa1c40a49dd4992f (patch)
tree87001ebafba8bc3c039d48c0977b92cc2e7498f5 /plugins
parentf6c3c1dd95a13bd412a07094c2a275b7eb7335ed (diff)
downloadprosody-6d0298961d6d4150aa43897baa1c40a49dd4992f.tar.gz
prosody-6d0298961d6d4150aa43897baa1c40a49dd4992f.zip
mod_s2s: Record stanza size limit advertised by other servers
For future use, i.e. canceling sending of stanzas that exceed the limit
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_s2s.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua
index ebd5633e..a8e707a0 100644
--- a/plugins/mod_s2s.lua
+++ b/plugins/mod_s2s.lua
@@ -250,6 +250,10 @@ function module.add_host(module)
module:hook("s2s-authenticated", make_authenticated, -1);
module:hook("s2s-read-timeout", keepalive, -1);
module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) -- luacheck: ignore 212/stanza
+ local limits = stanza:get_child("stanza-size-limit", "xmpp:prosody.im/stream/limits");
+ if limits then
+ session.outgoing_stanza_size_limit = tonumber(limits.attr.bytes);
+ end
if session.type == "s2sout" then
-- Stream is authenticated and we are seem to be done with feature negotiation,
-- so the stream is ready for stanzas. RFC 6120 Section 4.3