Commit 64e2a2fc authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-837 Fixed tpo!.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 9a8de89c
...@@ -269,8 +269,8 @@ ...@@ -269,8 +269,8 @@
// If a timeout is almost reached the server will break and sent the results it has until this // If a timeout is almost reached the server will break and sent the results it has until this
// point. You can add DeviceType strings to the categories. // point. You can add DeviceType strings to the categories.
// In general longer timeouts are better, because more data can be streamed at once. // In general longer timeouts are better, because more data can be streamed at once.
define('SYNC_TIMOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI"); define('SYNC_TIMEOUT_MEDIUM_DEVICETYPES', "SAMSUNGGTI");
define('SYNC_TIMOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook"); define('SYNC_TIMEOUT_LONG_DEVICETYPES', "iPod, iPad, iPhone, WP, WindowsOutlook");
/********************************************************************************** /**********************************************************************************
* Backend settings * Backend settings
......
...@@ -628,11 +628,11 @@ class Request { ...@@ -628,11 +628,11 @@ class Request {
if (!isset(self::$expectedConnectionTimeout)) { if (!isset(self::$expectedConnectionTimeout)) {
// Apple and Windows Phone have higher timeouts (4min = 240sec) // Apple and Windows Phone have higher timeouts (4min = 240sec)
if (stripos(SYNC_TIMOUT_LONG_DEVICETYPES, self::GetDeviceType()) !== false) { if (stripos(SYNC_TIMEOUT_LONG_DEVICETYPES, self::GetDeviceType()) !== false) {
self::$expectedConnectionTimeout = 210; self::$expectedConnectionTimeout = 210;
} }
// Samsung devices have a intermediate timeout (90sec) // Samsung devices have a intermediate timeout (90sec)
else if (stripos(SYNC_TIMOUT_MEDIUM_DEVICETYPES, self::GetDeviceType()) !== false) { else if (stripos(SYNC_TIMEOUT_MEDIUM_DEVICETYPES, self::GetDeviceType()) !== false) {
self::$expectedConnectionTimeout = 85; self::$expectedConnectionTimeout = 85;
} }
else { else {
......
...@@ -1089,7 +1089,7 @@ class Sync extends RequestProcessor { ...@@ -1089,7 +1089,7 @@ class Sync extends RequestProcessor {
} }
if($sc->GetParameter($spa, "getchanges") && $spa->HasFolderId() && $spa->HasContentClass() && $spa->HasSyncKey()) { if($sc->GetParameter($spa, "getchanges") && $spa->HasFolderId() && $spa->HasContentClass() && $spa->HasSyncKey()) {
$moreAvailbleSent = false; $moreAvailableSent = false;
$windowSize = self::$deviceManager->GetWindowSize($spa->GetFolderId(), $spa->GetUuid(), $spa->GetUuidCounter(), $changecount); $windowSize = self::$deviceManager->GetWindowSize($spa->GetFolderId(), $spa->GetUuid(), $spa->GetUuidCounter(), $changecount);
// limit windowSize to the max available limit of the global window size left // limit windowSize to the max available limit of the global window size left
...@@ -1102,7 +1102,7 @@ class Sync extends RequestProcessor { ...@@ -1102,7 +1102,7 @@ class Sync extends RequestProcessor {
// or there is a move state (another sync should be done afterwards) // or there is a move state (another sync should be done afterwards)
if($changecount > $windowSize || $spa->GetMoveState() !== false) { if($changecount > $windowSize || $spa->GetMoveState() !== false) {
self::$encoder->startTag(SYNC_MOREAVAILABLE, false, true); self::$encoder->startTag(SYNC_MOREAVAILABLE, false, true);
$moreAvailbleSent = true; $moreAvailableSent = true;
$spa->DelFolderStat(); $spa->DelFolderStat();
} }
} }
...@@ -1166,9 +1166,10 @@ class Sync extends RequestProcessor { ...@@ -1166,9 +1166,10 @@ class Sync extends RequestProcessor {
if (Request::IsRequestTimeoutReached()) { if (Request::IsRequestTimeoutReached()) {
ZLog::Write(LOGLEVEL_DEBUG, "HandleSync(): Stopping export as maximum request timeout is almost reached!"); ZLog::Write(LOGLEVEL_DEBUG, "HandleSync(): Stopping export as maximum request timeout is almost reached!");
// Send a <MoreAvailable/> tag if we reached the request timout, there are more changes and a moreavailable was not already send // Send a <MoreAvailable/> tag if we reached the request timout, there are more changes and a moreavailable was not already send
if (!$moreAvailbleSent && ($n > $windowSize)) { if (!$moreAvailableSent && ($n > $windowSize)) {
self::$encoder->startTag(SYNC_MOREAVAILABLE, false, true); self::$encoder->startTag(SYNC_MOREAVAILABLE, false, true);
$spa->DelFolderStat(); $spa->DelFolderStat();
$moreAvailableSent = true;
} }
} }
......
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