Changeset

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
parents 3492:f59334da6df9
children 3494:4feab7e87675
files mod_smacks/mod_smacks.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
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)