From f6c3c1dd95a13bd412a07094c2a275b7eb7335ed Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 16 Mar 2021 18:25:05 +0100 Subject: mod_s2s: Advertise stanza size limit to other servers So they can, like, not send big stanzas. --- plugins/mod_s2s.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_s2s.lua') diff --git a/plugins/mod_s2s.lua b/plugins/mod_s2s.lua index 7eae9043..ebd5633e 100644 --- a/plugins/mod_s2s.lua +++ b/plugins/mod_s2s.lua @@ -518,6 +518,11 @@ function stream_callbacks._streamopened(session, attr) end if ( session.type == "s2sin" or session.type == "s2sout" ) or features.tags[1] then + if stanza_size_limit then + features:reset(); + features:tag("stanza-size-limit", { xmlns = "xmpp:prosody.im/stream/limits", bytes = string.format("%d", stanza_size_limit) }); + end + log("debug", "Sending stream features: %s", features); session.sends2s(features); else -- cgit v1.2.3