[Pkg-owncloud-commits] [owncloud] 61/85: Added max heartbeat interval to prevent integer overflow
David Prévot
taffit at moszumanska.debian.org
Tue Jun 17 19:12:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch 6.0
in repository owncloud.
commit 00ec5fc1935c946e846a8ff28491e5b5b017b3d7
Author: Vincent Petry <pvince81 at owncloud.com>
Date: Thu Jun 12 18:26:08 2014 +0200
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.
---
core/js/js.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/core/js/js.js b/core/js/js.js
index 7f45a9b..80e9ac3 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -741,6 +741,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) {
@@ -750,6 +752,9 @@ function initCore() {
if (interval < 60) {
interval = 60;
}
+ if (interval > maxInterval) {
+ interval = maxInterval;
+ }
OC.Router.registerLoadedCallback(function(){
var url = OC.Router.generate('heartbeat');
setInterval(function(){
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list