Fix redundant keep-alive requests when session_lifetime is greater than ~20000 (#5273)

pull/5754/head
Aleksander Machniak 9 years ago
parent 77b5d7ee30
commit da96071780

@ -6,6 +6,7 @@ CHANGELOG Roundcube Webmail
- Fix so minified publickey.js (with cache-buster) is used when available (#5254) - 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 (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 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 RELEASE 1.2.0
------------- -------------

@ -8534,7 +8534,10 @@ function rcube_webmail()
if (this._keepalive) if (this._keepalive)
clearInterval(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 // starts interval for refresh signal

Loading…
Cancel
Save