diff options
author | Kim Alvefur <zash@zash.se> | 2023-07-16 20:49:33 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-07-16 20:49:33 +0200 |
commit | 1987a7411f6aab1b0534ef23dc8797362eae1076 (patch) | |
tree | 47c52d7b27c3b76cb1356f1a512105f1df2e8592 /plugins/mod_c2s.lua | |
parent | 903e945d09ffd94ebf3f08b6c5092a56ad484348 (diff) | |
download | prosody-1987a7411f6aab1b0534ef23dc8797362eae1076.tar.gz prosody-1987a7411f6aab1b0534ef23dc8797362eae1076.zip |
plugins: Switch to :get_option_period() for time range options
Improves readability ("1 day" vs 86400) and centralizes validation.
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r-- | plugins/mod_c2s.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua index e189498c..54eea210 100644 --- a/plugins/mod_c2s.lua +++ b/plugins/mod_c2s.lua @@ -25,8 +25,8 @@ local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams"; local log = module._log; -local c2s_timeout = module:get_option_number("c2s_timeout", 300); -local stream_close_timeout = module:get_option_number("c2s_close_timeout", 5); +local c2s_timeout = module:get_option_period("c2s_timeout", "5 minutes"); +local stream_close_timeout = module:get_option_period("c2s_close_timeout", 5); local opt_keepalives = module:get_option_boolean("c2s_tcp_keepalives", module:get_option_boolean("tcp_keepalives", true)); local stanza_size_limit = module:get_option_number("c2s_stanza_size_limit", 1024*256); |