diff --git a/CHANGELOG b/CHANGELOG index a74cced06..e0e7ed5e4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ CHANGELOG Roundcube Webmail - Fix so minified publickey.js (with cache-buster) is used when available (#5254) - Fix (replace) application/x-tar file extension test as it might not exist in nginx config (#5253) - Fix PHP warning when password_hosts is set, but is not an array (#5260) +- Fix redundant keep-alive requests when session_lifetime is greater than ~20000 (#5273) RELEASE 1.2.0 ------------- diff --git a/program/js/app.js b/program/js/app.js index 7dbe3b757..efe9a4351 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -8534,7 +8534,10 @@ function rcube_webmail() if (this._keepalive) clearInterval(this._keepalive); - this._keepalive = setInterval(function(){ ref.keep_alive(); }, this.env.session_lifetime * 0.5 * 1000); + // use Math to prevent from an integer overflow (#5273) + // maximum interval is 15 minutes, minimum is 30 seconds + var interval = Math.min(1800, this.env.session_lifetime) * 0.5 * 1000; + this._keepalive = setInterval(function() { ref.keep_alive(); }, interval < 30000 ? 30000 : interval); }; // starts interval for refresh signal