From: Claudio Cambra Date: Fri, 28 Jul 2023 07:37:49 +0000 (+0800) Subject: Start numbering chunks from 1 per chunking v2 api X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~9^2~24^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fbb513a26d97e2e2f101fcd06b52ac280808120f;p=nextcloud-desktop.git Start numbering chunks from 1 per chunking v2 api Signed-off-by: Claudio Cambra --- diff --git a/src/libsync/propagateupload.h b/src/libsync/propagateupload.h index 86a0e82eb..7f94dfe66 100644 --- a/src/libsync/propagateupload.h +++ b/src/libsync/propagateupload.h @@ -419,7 +419,7 @@ private: qint64 _sent = 0; /// amount of data (bytes) that was already sent uint _transferId = 0; /// transfer id (part of the url) - int _currentChunk = 0; /// Id of the next chunk that will be sent + int _currentChunk = 1; /// Id of the next chunk that will be sent qint64 _currentChunkSize = 0; /// current chunk size bool _removeJobError = false; /// If not null, there was an error removing the job }; diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 6c38a89f2..9757f32ae 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -141,7 +141,8 @@ void PropagateUploadFileNG::slotPropfindFinished() slotJobDestroyed(job); // remove it from the _jobs list propagator()->_activeJobList.removeOne(this); - _currentChunk = 0; + // Chunked upload v2: numbers range from 1 to 10000 + _currentChunk = 1; _sent = 0; while (_serverChunks.contains(_currentChunk)) { _sent += _serverChunks[_currentChunk].size; @@ -246,7 +247,7 @@ void PropagateUploadFileNG::startNewUpload() } _transferId = uint(Utility::rand() ^ uint(_item->_modtime) ^ (uint(_fileToUpload._size) << 16) ^ qHash(_fileToUpload._file)); _sent = 0; - _currentChunk = 0; + _currentChunk = 1; // Chunked upload v2: numbers range from 1 to 10000 propagator()->reportProgress(*_item, 0);