From 5fc9495c6b010f7af76afbe79f058a7d133923ef Mon Sep 17 00:00:00 2001 From: Michael J Rubinsky Date: Wed, 17 Feb 2016 12:01:26 -0500 Subject: [PATCH] Fix calculation of when to send MOREAVAILABLE tag. --- framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php index d27c3ba22e8..f3e19704c6b 100644 --- a/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php +++ b/framework/ActiveSync/lib/Horde/ActiveSync/Request/Sync.php @@ -496,12 +496,12 @@ protected function _handle() : $collection['windowsize']; if (!empty($changecount) && - (($changecount > $max_windowsize) || $cnt_global + $max_windowsize > $this->_collections->getDefaultWindowSize())) { + (($changecount > $max_windowsize) || $cnt_global + $changecount > $this->_collections->getDefaultWindowSize())) { $this->_logger->info(sprintf( '[%s] Sending MOREAVAILABLE. WINDOWSIZE = %d, $changecount = %d, MAX_REQUEST_WINDOWSIZE = %d, $cnt_global = %d', $this->_procid, $max_windowsize, $changecount, $this->_collections->getDefaultWindowSize(), $cnt_global)); $this->_encoder->startTag(Horde_ActiveSync::SYNC_MOREAVAILABLE, false, true); - $over_window = ($cnt_global + $max_windowsize > $this->_collections->getDefaultWindowSize()); + $over_window = ($cnt_global + $changecount > $this->_collections->getDefaultWindowSize()); } if (!empty($changecount)) {