Diff

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
line wrap: on
line diff
--- a/mod_smacks/mod_smacks.lua	Tue Mar 19 19:43:13 2019 +0100
+++ b/mod_smacks/mod_smacks.lua	Fri Mar 22 22:06:40 2019 +0000
@@ -44,6 +44,9 @@
 local core_process_stanza = prosody.core_process_stanza;
 local sessionmanager = require"core.sessionmanager";
 
+assert(max_hibernated_sessions > 0, "smacks_max_hibernated_sessions must be greater than 0");
+assert(max_old_sessions > 0, "smacks_old_sessions must be greater than 0");
+
 local c2s_sessions = module:shared("/*/c2s/sessions");
 
 local function init_session_cache(max_entries, evict_callback)