Comparison

plugins/mod_c2s.lua @ 13213:50324f66ca2a

plugins: Use integer config API with interval specification where sensible Many of these fall into a few categories: - util.cache size, must be >= 1 - byte or item counts that logically can't be negative - port numbers that should be in 1..0xffff
author Kim Alvefur <zash@zash.se>
date Mon, 17 Jul 2023 01:38:54 +0200
parent 13209:c8d949cf6b09
child 13230:26c30844cac6
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
26 local log = module._log; 26 local log = module._log;
27 27
28 local c2s_timeout = module:get_option_period("c2s_timeout", "5 minutes"); 28 local c2s_timeout = module:get_option_period("c2s_timeout", "5 minutes");
29 local stream_close_timeout = module:get_option_period("c2s_close_timeout", 5); 29 local stream_close_timeout = module:get_option_period("c2s_close_timeout", 5);
30 local opt_keepalives = module:get_option_boolean("c2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); 30 local opt_keepalives = module:get_option_boolean("c2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true));
31 local stanza_size_limit = module:get_option_number("c2s_stanza_size_limit", 1024*256); 31 local stanza_size_limit = module:get_option_integer("c2s_stanza_size_limit", 1024*256,10000);
32 32
33 local measure_connections = module:metric("gauge", "connections", "", "Established c2s connections", {"host", "type", "ip_family"}); 33 local measure_connections = module:metric("gauge", "connections", "", "Established c2s connections", {"host", "type", "ip_family"});
34 34
35 local sessions = module:shared("sessions"); 35 local sessions = module:shared("sessions");
36 local core_process_stanza = prosody.core_process_stanza; 36 local core_process_stanza = prosody.core_process_stanza;