Repair chunked uploads
authorKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 13 Jan 2021 17:00:19 +0000 (18:00 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Wed, 13 Jan 2021 17:00:19 +0000 (18:00 +0100)
There's been a confusion between the chunk number and the chunk
offset leading to corruptions... Let's pass the proper offset to
the UploadDevice again.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/libsync/propagateuploadng.cpp

index ca67b7c043734dd6dc4d41a141679088a84155e1..62d1fca0389375b92cb5010dcaeb4a87a44ff78b 100644 (file)
@@ -318,7 +318,7 @@ void PropagateUploadFileNG::startNextChunk()
 
     const QString fileName = _fileToUpload._path;
     auto device = std::make_unique<UploadDevice>(
-            fileName, _currentChunk, _currentChunkSize, &propagator()->_bandwidthManager);
+            fileName, _sent, _currentChunkSize, &propagator()->_bandwidthManager);
     if (!device->open(QIODevice::ReadOnly)) {
         qCWarning(lcPropagateUploadNG) << "Could not prepare upload device: " << device->errorString();