aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-31 22:39:34 +0200
committerKim Alvefur <zash@zash.se>2020-05-31 22:39:34 +0200
commit5abc2e6a5ce803060cd2c03182d3ae95bd29f694 (patch)
tree8b03f52ab8bb74a2cecbcf5f52687b900066b21f /plugins
parentd22e85debcc0a230f82af5b07e28f4248f63e072 (diff)
downloadprosody-5abc2e6a5ce803060cd2c03182d3ae95bd29f694.tar.gz
prosody-5abc2e6a5ce803060cd2c03182d3ae95bd29f694.zip
mod_c2s,mod_s2s: Make stanza size limits configurable
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_c2s.lua3
-rw-r--r--plugins/mod_s2s/mod_s2s.lua3
2 files changed, 4 insertions, 2 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index c6a95e9e..ef4bd4b3 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -26,6 +26,7 @@ local log = module._log;
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 @@ function listener.onconnect(conn)
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;
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index bd6627b8..0674f981 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -39,6 +39,7 @@ local secure_auth = module:get_option_boolean("s2s_secure_auth", false); -- One
local secure_domains, insecure_domains =
module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items;
local require_encryption = module:get_option_boolean("s2s_require_encryption", false);
+local stanza_size_limit = module:get_option_number("s2s_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");
@@ -566,7 +567,7 @@ end
-- Session initialization logic shared by incoming and outgoing
local function initialize_session(session)
- local stream = new_xmpp_stream(session, stream_callbacks);
+ local stream = new_xmpp_stream(session, stream_callbacks, stanza_size_limit);
session.thread = runner(function (stanza)
if st.is_stanza(stanza) then