# HG changeset patch # User tmolitor # Date 1618231828 -7200 # Node ID 4e7aa32f58d969809330bc4dea43ab3e74291a1c # Parent 591c643d55b2c5b84f309d48ca06dcf86e6f7989 mod_smacks: Fix calculation of smacks timeout values diff -r 591c643d55b2 -r 4e7aa32f58d9 mod_smacks/mod_smacks.lua --- a/mod_smacks/mod_smacks.lua Sat Apr 10 01:16:02 2021 +0200 +++ b/mod_smacks/mod_smacks.lua Mon Apr 12 14:50:28 2021 +0200 @@ -506,9 +506,9 @@ session.log("debug", "No push happened since hibernation started, hibernating session for up to %d extra seconds", resume_timeout); return resume_timeout; end - if current_time-timeout_start < resume_timeout and session.push_identifier ~= nil then - session.log("debug", "A push happened since hibernation started, hibernating session for up to %d extra seconds", current_time-timeout_start); - return current_time-timeout_start; -- time left to wait + if session.push_identifier ~= nil and current_time-timeout_start < resume_timeout then + session.log("debug", "A push happened since hibernation started, hibernating session for up to %d extra seconds", resume_timeout-(current_time-timeout_start)); + return resume_timeout-(current_time-timeout_start); -- time left to wait end session.log("debug", "Destroying session for hibernating too long"); session_registry.set(session.username, session.resumption_token, nil);