Comparison

plugins/mod_websocket.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
comparison
equal deleted inserted replaced
13212:3e6e98cc63e9 13213:50324f66ca2a
26 local build_close = websocket_frames.build_close; 26 local build_close = websocket_frames.build_close;
27 local parse_close = websocket_frames.parse_close; 27 local parse_close = websocket_frames.parse_close;
28 28
29 local t_concat = table.concat; 29 local t_concat = table.concat;
30 30
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 local frame_buffer_limit = module:get_option_number("websocket_frame_buffer_limit", 2 * stanza_size_limit); 32 local frame_buffer_limit = module:get_option_integer("websocket_frame_buffer_limit", 2 * stanza_size_limit, 0);
33 local frame_fragment_limit = module:get_option_number("websocket_frame_fragment_limit", 8); 33 local frame_fragment_limit = module:get_option_integer("websocket_frame_fragment_limit", 8, 0);
34 local stream_close_timeout = module:get_option_period("c2s_close_timeout", 5); 34 local stream_close_timeout = module:get_option_period("c2s_close_timeout", 5);
35 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure"); 35 local consider_websocket_secure = module:get_option_boolean("consider_websocket_secure");
36 local cross_domain = module:get_option("cross_domain_websocket"); 36 local cross_domain = module:get_option("cross_domain_websocket");
37 if cross_domain ~= nil then 37 if cross_domain ~= nil then
38 module:log("info", "The 'cross_domain_websocket' option has been deprecated"); 38 module:log("info", "The 'cross_domain_websocket' option has been deprecated");