# HG changeset patch # User Kim Alvefur # Date 1683129731 -7200 # Node ID 93c68c454cb8fbe0af367b60e08670ec0f044c1f # Parent bc46cfe7c037a16ea1d45d77e0d30f8c66b7dc2f mod_c2s,mod_s2s: Fix tag name for SLA (thanks mjk) The (still not published) XEP-xxxx: Stream Limits Advertisement uses the element to advertise the maximum octet size of top level stream elements. "size" was probably a leftover of an even earlier version of the (Proto)XEP. diff -r bc46cfe7c037 -r 93c68c454cb8 plugins/mod_c2s.lua --- a/plugins/mod_c2s.lua Mon May 01 22:24:13 2023 +0200 +++ b/plugins/mod_c2s.lua Wed May 03 18:02:11 2023 +0200 @@ -133,7 +133,7 @@ if stanza_size_limit then features:reset(); features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" }) - :text_tag("max-size", string.format("%d", stanza_size_limit)):up(); + :text_tag("max-bytes", string.format("%d", stanza_size_limit)):up(); end send(features); else diff -r bc46cfe7c037 -r 93c68c454cb8 plugins/mod_s2s.lua --- a/plugins/mod_s2s.lua Mon May 01 22:24:13 2023 +0200 +++ b/plugins/mod_s2s.lua Wed May 03 18:02:11 2023 +0200 @@ -250,14 +250,14 @@ module:hook("s2sout-stream-features", function (event) if stanza_size_limit then event.features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" }) - :text_tag("max-size", string.format("%d", stanza_size_limit)):up(); + :text_tag("max-bytes", string.format("%d", stanza_size_limit)):up(); end end); module:hook_tag("urn:xmpp:bidi", "bidi", function(session, stanza) -- Advertising features on bidi connections where no is sent in the other direction local limits = stanza:get_child("limits", "urn:xmpp:stream-limits:0"); if limits then - session.outgoing_stanza_size_limit = tonumber(limits:get_child_text("max-size")); + session.outgoing_stanza_size_limit = tonumber(limits:get_child_text("max-bytes")); end end, 100); module:hook("s2s-authenticated", make_authenticated, -1); @@ -265,7 +265,7 @@ module:hook_stanza("http://etherx.jabber.org/streams", "features", function (session, stanza) -- luacheck: ignore 212/stanza local limits = stanza:get_child("limits", "urn:xmpp:stream-limits:0"); if limits then - session.outgoing_stanza_size_limit = tonumber(limits:get_child_text("max-size")); + session.outgoing_stanza_size_limit = tonumber(limits:get_child_text("max-bytes")); end if session.type == "s2sout" then -- Stream is authenticated and we are seem to be done with feature negotiation, @@ -538,7 +538,7 @@ if stanza_size_limit then features:reset(); features:tag("limits", { xmlns = "urn:xmpp:stream-limits:0" }) - :text_tag("max-size", string.format("%d", stanza_size_limit)):up(); + :text_tag("max-bytes", string.format("%d", stanza_size_limit)):up(); end log("debug", "Sending stream features: %s", features);