# HG changeset patch # User Kim Alvefur # Date 1615915834 -3600 # Node ID 751bdd41291599ba51fba3abcec690fe35b3cbb4 # Parent d96e24bd54e18634562ac1b421c45bb644d3bafc mod_s2s: Record stanza size limit advertised by other servers For future use, i.e. canceling sending of stanzas that exceed the limit diff -r d96e24bd54e1 -r 751bdd412915 plugins/mod_s2s.lua --- a/plugins/mod_s2s.lua Tue Mar 16 18:25:05 2021 +0100 +++ b/plugins/mod_s2s.lua Tue Mar 16 18:30:34 2021 +0100 @@ -250,6 +250,10 @@ 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