# HG changeset patch # User Kim Alvefur # Date 1689952980 -7200 # Node ID 26c30844cac63468d17ddef0dd03fe144245cf8f # Parent bb7177efbf41032da287d2482d099669e78cb406 plugins: Handle how get_option_period returns "never" diff -r bb7177efbf41 -r 26c30844cac6 plugins/mod_c2s.lua --- a/plugins/mod_c2s.lua Tue Jul 18 12:38:16 2023 +0200 +++ b/plugins/mod_c2s.lua Fri Jul 21 17:23:00 2023 +0200 @@ -367,7 +367,7 @@ end end - if c2s_timeout then + if c2s_timeout < math.huge then add_task(c2s_timeout, function () if session.type == "c2s_unauthed" then (session.log or log)("debug", "Connection still not authenticated after c2s_timeout=%gs, closing it", c2s_timeout); diff -r bb7177efbf41 -r 26c30844cac6 plugins/mod_http_file_share.lua --- a/plugins/mod_http_file_share.lua Tue Jul 18 12:38:16 2023 +0200 +++ b/plugins/mod_http_file_share.lua Fri Jul 21 17:23:00 2023 +0200 @@ -176,7 +176,7 @@ -- slot properties slot = slot; - expires = expiry >= 0 and (os.time()+expiry) or nil; + expires = expiry < math.huge and (os.time()+expiry) or nil; -- file properties filename = filename; filesize = filesize; diff -r bb7177efbf41 -r 26c30844cac6 plugins/mod_mam/mod_mam.lua --- a/plugins/mod_mam/mod_mam.lua Tue Jul 18 12:38:16 2023 +0200 +++ b/plugins/mod_mam/mod_mam.lua Fri Jul 21 17:23:00 2023 +0200 @@ -441,7 +441,7 @@ local time = time_now(); local ok, err = archive:append(store_user, nil, clone_for_storage, time, with); if not ok and err == "quota-limit" then - if type(cleanup_after) == "number" then + if cleanup_after ~= math.huge then module:log("debug", "User '%s' over quota, cleaning archive", store_user); local cleaned = archive:delete(store_user, { ["end"] = (os.time() - cleanup_after); @@ -506,7 +506,7 @@ end end); -if cleanup_after ~= "never" then +if cleanup_after ~= math.huge then local cleanup_storage = module:open_store("archive_cleanup"); local cleanup_map = module:open_store("archive_cleanup", "map");