Diff

plugins/mod_c2s.lua @ 10850:bd2814f900dd

mod_c2s,mod_s2s: Make stanza size limits configurable
author Kim Alvefur <zash@zash.se>
date Sun, 31 May 2020 22:39:34 +0200
parent 10849:19e7092e062c
child 11120:b2331f3dfeea
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Sun May 31 22:25:48 2020 +0200
+++ b/plugins/mod_c2s.lua	Sun May 31 22:39:34 2020 +0200
@@ -26,6 +26,7 @@
 local c2s_timeout = module:get_option_number("c2s_timeout", 300);
 local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5);
 local opt_keepalives = module:get_option_boolean("c2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true));
+local stanza_size_limit = module:get_option_number("c2s_stanza_size_limit"); -- TODO come up with a sensible default (util.xmppstream defaults to 10M)
 
 local measure_connections = module:measure("connections", "amount");
 local measure_ipv6 = module:measure("ipv6", "amount");
@@ -280,7 +281,7 @@
 
 	session.close = session_close;
 
-	local stream = new_xmpp_stream(session, stream_callbacks);
+	local stream = new_xmpp_stream(session, stream_callbacks, stanza_size_limit);
 	session.stream = stream;
 	session.notopen = true;