Commit bb60cb47 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-728 Use constant WINDOW_SIZE_MAX for the max window size.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 8cff4572
...@@ -474,7 +474,7 @@ class DeviceManager { ...@@ -474,7 +474,7 @@ class DeviceManager {
if (isset($this->windowSize[$folderid])) if (isset($this->windowSize[$folderid]))
$items = $this->windowSize[$folderid]; $items = $this->windowSize[$folderid];
else else
$items = 512; $items = WINDOW_SIZE_MAX; // 512 by default
$this->setLatestFolder($folderid); $this->setLatestFolder($folderid);
......
...@@ -343,7 +343,7 @@ class SyncCollections implements Iterator { ...@@ -343,7 +343,7 @@ class SyncCollections implements Iterator {
$globalWindowSize = $this->globalWindowSize; $globalWindowSize = $this->globalWindowSize;
} }
else { else {
$globalWindowSize = 512; $globalWindowSize = WINDOW_SIZE_MAX; // 512 by default
} }
if (defined("SYNC_MAX_ITEMS") && SYNC_MAX_ITEMS < $globalWindowSize) { if (defined("SYNC_MAX_ITEMS") && SYNC_MAX_ITEMS < $globalWindowSize) {
......
...@@ -998,6 +998,7 @@ define("HTTP_CODE_401", 401); ...@@ -998,6 +998,7 @@ define("HTTP_CODE_401", 401);
define("HTTP_CODE_449", 449); define("HTTP_CODE_449", 449);
define("HTTP_CODE_500", 500); define("HTTP_CODE_500", 500);
define("WINDOW_SIZE_MAX", 512);
//logging defs //logging defs
define("LOGLEVEL_OFF", 0); define("LOGLEVEL_OFF", 0);
......
...@@ -233,8 +233,8 @@ class Sync extends RequestProcessor { ...@@ -233,8 +233,8 @@ class Sync extends RequestProcessor {
if(self::$decoder->getElementStartTag(SYNC_WINDOWSIZE)) { if(self::$decoder->getElementStartTag(SYNC_WINDOWSIZE)) {
$ws = self::$decoder->getElementContent(); $ws = self::$decoder->getElementContent();
// normalize windowsize - see ZP-477 // normalize windowsize - see ZP-477
if ($ws == 0 || $ws > 512) if ($ws == 0 || $ws > WINDOW_SIZE_MAX)
$ws = 512; $ws = WINDOW_SIZE_MAX;
$spa->SetWindowSize($ws); $spa->SetWindowSize($ws);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment