util.xmppstream: Allow dynamically configuring the stanza size limit for a stream 0.11
authorMatthew Wild <mwild1@gmail.com>
Mon, 10 May 2021 17:03:27 +0100
branch0.11
changeset 11551 dd21eb632f52
parent 11550 b21d8c286973
child 11552 55ef50d6cf65
util.xmppstream: Allow dynamically configuring the stanza size limit for a stream This may be useful for any plugins that want to experiment with different policies for stanza size limits (e.g. unauthenticated vs authenticated streams).
util/xmppstream.lua
--- a/util/xmppstream.lua	Mon May 10 17:02:37 2021 +0100
+++ b/util/xmppstream.lua	Mon May 10 17:03:27 2021 +0100
@@ -293,6 +293,9 @@
 			return ok, err;
 		end,
 		set_session = meta.set_session;
+		set_stanza_size_limit = function (_, new_stanza_size_limit)
+			stanza_size_limit = new_stanza_size_limit;
+		end;
 	};
 end