Software /
code /
prosody-modules
Comparison
mod_smacks/mod_smacks.lua @ 3493:3d4eefdd950a
mod_smacks: Raise error on out-of-range config options (thanks marc0s)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 22 Mar 2019 22:06:40 +0000 |
parent | 3479:9ef309fb501d |
child | 3620:fb1c8dee2ead |
comparison
equal
deleted
inserted
replaced
3492:f59334da6df9 | 3493:3d4eefdd950a |
---|---|
41 local delayed_ack_timeout = module:get_option_number("smacks_max_ack_delay", 60); | 41 local delayed_ack_timeout = module:get_option_number("smacks_max_ack_delay", 60); |
42 local max_hibernated_sessions = module:get_option_number("smacks_max_hibernated_sessions", 10); | 42 local max_hibernated_sessions = module:get_option_number("smacks_max_hibernated_sessions", 10); |
43 local max_old_sessions = module:get_option_number("smacks_max_old_sessions", 10); | 43 local max_old_sessions = module:get_option_number("smacks_max_old_sessions", 10); |
44 local core_process_stanza = prosody.core_process_stanza; | 44 local core_process_stanza = prosody.core_process_stanza; |
45 local sessionmanager = require"core.sessionmanager"; | 45 local sessionmanager = require"core.sessionmanager"; |
46 | |
47 assert(max_hibernated_sessions > 0, "smacks_max_hibernated_sessions must be greater than 0"); | |
48 assert(max_old_sessions > 0, "smacks_old_sessions must be greater than 0"); | |
46 | 49 |
47 local c2s_sessions = module:shared("/*/c2s/sessions"); | 50 local c2s_sessions = module:shared("/*/c2s/sessions"); |
48 | 51 |
49 local function init_session_cache(max_entries, evict_callback) | 52 local function init_session_cache(max_entries, evict_callback) |
50 -- old prosody version < 0.10 (no limiting at all!) | 53 -- old prosody version < 0.10 (no limiting at all!) |