Page MenuHomePhorge

D5430.1775215360.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5430.1775215360.diff

diff --git a/lib/ext/Syncroton/Command/FolderSync.php b/lib/ext/Syncroton/Command/FolderSync.php
--- a/lib/ext/Syncroton/Command/FolderSync.php
+++ b/lib/ext/Syncroton/Command/FolderSync.php
@@ -119,15 +119,25 @@
if ($this->_logger instanceof Zend_Log) {
$this->_logger->info(__METHOD__ . '::' . __LINE__ . " already known synckey $syncKey provided ($retryCounter times)");
}
+ $sleepTime = 2;
if ($retryCounter >= 10) {
if ($this->_logger instanceof Zend_Log) {
$this->_logger->warn(__METHOD__ . '::' . __LINE__ . " This client is stuck on resending the same FolderSync synckey.");
}
+ call_user_func(Syncroton_Registry::getSleepCallback());
+ sleep(10);
+ header('X-MS-ASThrottle: CommandFrequency');
+ header('HTTP/1.1 503 Service Unavailable');
+ exit;
} else {
$extraData['retryCounter'] = $retryCounter;
$this->_syncState->extraData = json_encode($extraData);
$this->_syncStateBackend->update($this->_syncState);
}
+ // Throttle clients that are stuck in a loop.
+ // We shouldn't normally hit this codepath, so this does not have any impact on regular synchronization at all,
+ // but protects us from too many requests from clients that are stuck in a loop.
+ sleep($sleepTime);
}
}
}

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 11:22 AM (18 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823815
Default Alt Text
D5430.1775215360.diff (1 KB)

Event Timeline