Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117761985
D5430.1775215360.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D5430.1775215360.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5430: Sleep when a client keeps resending the same FolderSync request.
Attached
Detach File
Event Timeline