From a2addaa126ca0dd7b19ab60df77ae1532746761b Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 3 Jun 2010 09:57:22 -0400 Subject: [PATCH] Implement windowsize support more in line with specs. Per MS specs, windowsize should default to 100 if not specified by client, and should default to 512 (the max) if the value specified is out of range. --- framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php index c510b2282..1c13cc65e 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php @@ -121,6 +121,16 @@ class Horde_ActiveSync_Request_Sync extends Horde_ActiveSync_Request_Base } } + /* Default window size = 100 / max window size = 512 */ + if (!isset($collection['windowsize'])) { + $this->_logger->debug('[' . $this->_device->id . '] No windowsize sent, defaulting to 100'); + $collection['windowsize'] = 100; + } elseif ($collection['windowsize'] < 1 || $collection['windowsize'] > 512) { + // per specs, out or range values default to 512 + $this->_logger->debug('[' . $this->_device->id . '] Bad windowsize sent, defaulting to 512'); + $collection['windowsize'] = 512; + } + if ($this->_decoder->getElementStartTag(Horde_ActiveSync::SYNC_OPTIONS)) { while(1) { if ($this->_decoder->getElementStartTag(Horde_ActiveSync::SYNC_FILTERTYPE)) { -- 2.11.0