From: Michael J. Rubinsky Date: Thu, 3 Jun 2010 13:57:22 +0000 (-0400) Subject: Implement windowsize support more in line with specs. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=a2addaa126ca0dd7b19ab60df77ae1532746761b;p=horde.git 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. --- 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)) {