diff options
author | Kim Alvefur <zash@zash.se> | 2023-07-17 01:38:54 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-07-17 01:38:54 +0200 |
commit | 71ad48095d92dd52a415eef499da32f8c27bb7fe (patch) | |
tree | 0287ae06ee488c1b62e9e3eccbf4a9ae74b8370d /plugins/mod_smacks.lua | |
parent | 55768509a3f15b0476289f7a338d02e7233d1926 (diff) | |
download | prosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.tar.gz prosody-71ad48095d92dd52a415eef499da32f8c27bb7fe.zip |
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
Diffstat (limited to 'plugins/mod_smacks.lua')
-rw-r--r-- | plugins/mod_smacks.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/mod_smacks.lua b/plugins/mod_smacks.lua index d4f2f546..486f611a 100644 --- a/plugins/mod_smacks.lua +++ b/plugins/mod_smacks.lua @@ -66,14 +66,14 @@ local xmlns_sm3 = "urn:xmpp:sm:3"; local sm2_attr = { xmlns = xmlns_sm2 }; local sm3_attr = { xmlns = xmlns_sm3 }; -local queue_size = module:get_option_number("smacks_max_queue_size", 500); +local queue_size = module:get_option_integer("smacks_max_queue_size", 500, 1); local resume_timeout = module:get_option_period("smacks_hibernation_time", "10 minutes"); local s2s_smacks = module:get_option_boolean("smacks_enabled_s2s", true); local s2s_resend = module:get_option_boolean("smacks_s2s_resend", false); -local max_unacked_stanzas = module:get_option_number("smacks_max_unacked_stanzas", 0); -local max_inactive_unacked_stanzas = module:get_option_number("smacks_max_inactive_unacked_stanzas", 256); +local max_unacked_stanzas = module:get_option_integer("smacks_max_unacked_stanzas", 0, 0); +local max_inactive_unacked_stanzas = module:get_option_integer("smacks_max_inactive_unacked_stanzas", 256, 0); local delayed_ack_timeout = module:get_option_period("smacks_max_ack_delay", 30); -local max_old_sessions = module:get_option_number("smacks_max_old_sessions", 10); +local max_old_sessions = module:get_option_integer("smacks_max_old_sessions", 10, 0); local c2s_sessions = module:shared("/*/c2s/sessions"); local local_sessions = prosody.hosts[module.host].sessions; |