libsync: Clear the upload info after several retries (#5345)
authorOlivier Goffart <olivier@woboq.com>
Mon, 5 Dec 2016 16:21:36 +0000 (17:21 +0100)
committerMarkus Goetz <markus@woboq.com>
Mon, 5 Dec 2016 16:21:36 +0000 (17:21 +0100)
Issue #5344

src/libsync/owncloudpropagator.cpp

index 38011862d6f0ec662d1fbbb4e99acb762495aae5..e2ce6c5dde99d10f907390a80c831608c531ca86 100644 (file)
@@ -108,6 +108,11 @@ static bool blacklistCheck(SyncJournalDb* journal, const SyncFileItem& item)
 
     if (newEntry.isValid()) {
         journal->updateErrorBlacklistEntry(newEntry);
+        // Also clear upload info if any so we don't resume from the same transfer-id if there was too many failures (#5344)
+        // (maybe the reason is that the state for this transfer id is broken on the server.)
+        if (newEntry._retryCount > 3) {
+            journal->setUploadInfo(item._file, SyncJournalDb::UploadInfo());
+        }
     } else if (oldEntry.isValid()) {
         journal->wipeErrorBlacklistEntry(item._file);
     }