aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-03-16 18:25:05 +0100
committerKim Alvefur <zash@zash.se>2021-03-16 18:25:05 +0100
commitf6c3c1dd95a13bd412a07094c2a275b7eb7335ed (patch)
tree361f3aae933e4a5fa578b92e548e1a547b2eeab5 /plugins/mod_s2s.lua
parentb8c31f2d5c649cf0b0d5f1f8c2e8157ada744442 (diff)
downloadprosody-f6c3c1dd95a13bd412a07094c2a275b7eb7335ed.tar.gz
prosody-f6c3c1dd95a13bd412a07094c2a275b7eb7335ed.zip
mod_s2s: Advertise stanza size limit to other servers
So they can, like, not send big stanzas.
Diffstat (limited to 'plugins/mod_s2s.lua')
-rw-r--r--plugins/mod_s2s.lua5
1 files changed, 5 insertions, 0 deletions
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