From e1a191acc64bb7abcda533007facc1a4f94c5ea9 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Sat, 24 Apr 2010 15:30:51 -0400 Subject: [PATCH] Add configuration switch for forcing the server heartbeat interval. For those of us who don't like devices telling us what we have to do...allow overriding the heartbeat interval so we can force it to be shorter then most devices would request...useful for managing load on the server. --- .../lib/Horde/ActiveSync/Request/Ping.php | 3 +++ horde/config/conf.xml | 28 +++++++++++++++------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php index c4ab8ed45..cde1ff3ea 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Ping.php @@ -42,6 +42,9 @@ class Horde_ActiveSync_Request_Ping extends Horde_ActiveSync_Request_Base protected function _checkHeartbeat($lifetime) { + if ($this->_ping_settings['forcedheartbeat']) { + return $this->_ping_settings['forcedheartbeat']; + } if ($lifetime !== 0 && $lifetime < $this->_ping_settings['heartbeatmin']) { $this->_statusCode = self::STATUS_HBOUTOFBOUNDS; $lifetime = $this->_ping_settings['heartbeatmin']; diff --git a/horde/config/conf.xml b/horde/config/conf.xml index c7275dcc1..f0fd854fd 100644 --- a/horde/config/conf.xml +++ b/horde/config/conf.xml @@ -2022,15 +2022,25 @@ correctly. If you plan on synching Android devices, you should make sure that this range is wide enough to allow Android's default of 470 seconds. - 60 - - 2700 - 480 - + true + + 60 + + 2700 + 480 + + + + 60 + + +