Comparison

plugins/mod_s2s/mod_s2s.lua @ 11118:ece430d49809 0.11 0.11.7

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 11018:bacca65ce107
child 11226:b3ae48362f78
comparison
equal deleted inserted replaced
11117:590ac42d81c5 11118:ece430d49809
35 local opt_keepalives = module:get_option_boolean("s2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); 35 local opt_keepalives = module:get_option_boolean("s2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true));
36 local secure_auth = module:get_option_boolean("s2s_secure_auth", false); -- One day... 36 local secure_auth = module:get_option_boolean("s2s_secure_auth", false); -- One day...
37 local secure_domains, insecure_domains = 37 local secure_domains, insecure_domains =
38 module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items; 38 module:get_option_set("s2s_secure_domains", {})._items, module:get_option_set("s2s_insecure_domains", {})._items;
39 local require_encryption = module:get_option_boolean("s2s_require_encryption", false); 39 local require_encryption = module:get_option_boolean("s2s_require_encryption", false);
40 local stanza_size_limit = module:get_option_number("s2s_stanza_size_limit"); -- TODO come up with a sensible default (util.xmppstream defaults to 10M)
40 41
41 local measure_connections = module:measure("connections", "amount"); 42 local measure_connections = module:measure("connections", "amount");
42 local measure_ipv6 = module:measure("ipv6", "amount"); 43 local measure_ipv6 = module:measure("ipv6", "amount");
43 44
44 local sessions = module:shared("sessions"); 45 local sessions = module:shared("sessions");
548 end 549 end
549 end 550 end
550 551
551 -- Session initialization logic shared by incoming and outgoing 552 -- Session initialization logic shared by incoming and outgoing
552 local function initialize_session(session) 553 local function initialize_session(session)
553 local stream = new_xmpp_stream(session, stream_callbacks); 554 local stream = new_xmpp_stream(session, stream_callbacks, stanza_size_limit);
554 555
555 session.thread = runner(function (stanza) 556 session.thread = runner(function (stanza)
556 if stanza.name == nil then 557 if stanza.name == nil then
557 stream_callbacks._streamopened(session, stanza.attr); 558 stream_callbacks._streamopened(session, stanza.attr);
558 else 559 else