diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-06-12 18:41:19 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-06-12 18:41:19 +0200 |
commit | ce168c286ac0ebd8c38a659880f85d270c697b69 (patch) | |
tree | 91f2c917e123f5fe50bedf4f8a43267351f9564d /core/js/js.js | |
parent | ab7cff6dfd63213746a29f4c0557e92a84561498 (diff) | |
download | nextcloud-server-ce168c286ac0ebd8c38a659880f85d270c697b69.tar.gz nextcloud-server-ce168c286ac0ebd8c38a659880f85d270c697b69.zip |
Added max heartbeat interval to prevent integer overflow
When using big session timeout values, the interval value might
overflow and cause the setInterval() call to ping the server in a loop
without any delay.
This fix adds a maximum ping interval of 24 hours.
Forward port of 00ec5fc1935c946e846a8ff28491e5b5b017b3d7 from stable6.
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 1d5219eff12..a8dd9ca889d 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -968,6 +968,8 @@ function initCore() { * time out */ function initSessionHeartBeat(){ + // max interval in seconds set to 24 hours + var maxInterval = 24 * 3600; // interval in seconds var interval = 900; if (oc_config.session_lifetime) { @@ -977,6 +979,9 @@ function initCore() { if (interval < 60) { interval = 60; } + if (interval > maxInterval) { + interval = maxInterval; + } var url = OC.generateUrl('/heartbeat'); setInterval(function(){ $.post(url); |