Commit c9b7d714 authored by Sebastian Kummer's avatar Sebastian Kummer

Revert "Merge pull request #70 in ZP/z-push from...

Revert "Merge pull request #70 in ZP/z-push from bugfix/ZP-728-change-usage-of-sync_max_items to develop"

This reverts commit 725bec89.
parent b34ea6b5
...@@ -474,7 +474,13 @@ class DeviceManager { ...@@ -474,7 +474,13 @@ class DeviceManager {
if (isset($this->windowSize[$folderid])) if (isset($this->windowSize[$folderid]))
$items = $this->windowSize[$folderid]; $items = $this->windowSize[$folderid];
else else
$items = WINDOW_SIZE_MAX; // 512 by default $items = (defined("SYNC_MAX_ITEMS")) ? SYNC_MAX_ITEMS : 100;
if (defined("SYNC_MAX_ITEMS") && SYNC_MAX_ITEMS < $items) {
if ($queuedmessages > SYNC_MAX_ITEMS)
ZLog::Write(LOGLEVEL_DEBUG, sprintf("DeviceManager->GetWindowSize() overwriting max items requested of %d by %d forced in configuration.", $items, SYNC_MAX_ITEMS));
$items = SYNC_MAX_ITEMS;
}
$this->setLatestFolder($folderid); $this->setLatestFolder($folderid);
......
...@@ -330,28 +330,17 @@ class SyncCollections implements Iterator { ...@@ -330,28 +330,17 @@ class SyncCollections implements Iterator {
} }
/** /**
* Returns the global window size of items to be exported in total over all * Returns the global window size which should be used for all collections
* requested collections. * in a case of a heartbeat and/or partial sync
* *
* @access public * @access public
* @return int/boolean returns requested windows size, 512 (max) or the * @return int/boolean returns 512 (max) if not set or not available
* value of config SYNC_MAX_ITEMS if it is lower
*/ */
public function GetGlobalWindowSize() { public function GetGlobalWindowSize() {
// take the requested global windowsize or the max 512 if not defined if (!isset($this->globalWindowSize))
if (isset($this->globalWindowSize)) { return 512;
$globalWindowSize = $this->globalWindowSize;
}
else {
$globalWindowSize = WINDOW_SIZE_MAX; // 512 by default
}
if (defined("SYNC_MAX_ITEMS") && SYNC_MAX_ITEMS < $globalWindowSize) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("SyncCollections->GetGlobalWindowSize() overwriting requested global window size of %d by %d forced in configuration.", $globalWindowSize, SYNC_MAX_ITEMS));
$globalWindowSize = SYNC_MAX_ITEMS;
}
return $globalWindowSize; return $this->globalWindowSize;
} }
/** /**
......
...@@ -998,7 +998,6 @@ define("HTTP_CODE_401", 401); ...@@ -998,7 +998,6 @@ 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);
......
...@@ -232,8 +232,8 @@ class Sync extends RequestProcessor { ...@@ -232,8 +232,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 > WINDOW_SIZE_MAX) if ($ws == 0 || $ws > 512)
$ws = WINDOW_SIZE_MAX; $ws = 512;
$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