From: Kevin Ottens Date: Tue, 1 Dec 2020 11:33:29 +0000 (+0100) Subject: Repair E2EE uploads X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~48 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=961794669ea9499d4567055448a1f7216ac3b835;p=nextcloud-desktop.git Repair E2EE uploads Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/propagateupload.cpp b/src/libsync/propagateupload.cpp index 8956397c8..122911037 100644 --- a/src/libsync/propagateupload.cpp +++ b/src/libsync/propagateupload.cpp @@ -370,7 +370,7 @@ void PropagateUploadFileCommon::slotComputeContentChecksum() this, &PropagateUploadFileCommon::slotComputeTransmissionChecksum); connect(computeChecksum, &ComputeChecksum::done, computeChecksum, &QObject::deleteLater); - computeChecksum->start(filePath); + computeChecksum->start(_fileToUpload._path); } void PropagateUploadFileCommon::slotComputeTransmissionChecksum(const QByteArray &contentChecksumType, const QByteArray &contentChecksum) @@ -397,8 +397,7 @@ void PropagateUploadFileCommon::slotComputeTransmissionChecksum(const QByteArray this, &PropagateUploadFileCommon::slotStartUpload); connect(computeChecksum, &ComputeChecksum::done, computeChecksum, &QObject::deleteLater); - const QString filePath = propagator()->fullLocalPath(_item->_file); - computeChecksum->start(filePath); + computeChecksum->start(_fileToUpload._path); } void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionChecksumType, const QByteArray &transmissionChecksum) @@ -414,7 +413,7 @@ void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionCh _item->_checksumHeader = _transmissionChecksumHeader; } - const QString fullFilePath = propagator()->fullLocalPath(_fileToUpload._file); + const QString fullFilePath = _fileToUpload._path; const QString originalFilePath = propagator()->fullLocalPath(_item->_file); if (!FileSystem::fileExists(fullFilePath)) { @@ -439,9 +438,8 @@ void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionCh return; } - qint64 fileSize = FileSystem::getSize(fullFilePath); - _item->_size = fileSize; - _fileToUpload._size = fileSize; + _fileToUpload._size = FileSystem::getSize(fullFilePath); + _item->_size = FileSystem::getSize(originalFilePath); // But skip the file if the mtime is too close to 'now'! // That usually indicates a file that is still being changed diff --git a/src/libsync/propagateuploadng.cpp b/src/libsync/propagateuploadng.cpp index 8f9dfe88e..e45d09d16 100644 --- a/src/libsync/propagateuploadng.cpp +++ b/src/libsync/propagateuploadng.cpp @@ -316,7 +316,7 @@ void PropagateUploadFileNG::startNextChunk() return; } - const QString fileName = propagator()->fullLocalPath(_fileToUpload._file); + const QString fileName = _fileToUpload._path; auto device = std::make_unique( fileName, _currentChunk, _currentChunkSize, &propagator()->_bandwidthManager); if (!device->open(QIODevice::ReadOnly)) { diff --git a/src/libsync/propagateuploadv1.cpp b/src/libsync/propagateuploadv1.cpp index 761964c1b..8e4ec1e05 100644 --- a/src/libsync/propagateuploadv1.cpp +++ b/src/libsync/propagateuploadv1.cpp @@ -122,7 +122,7 @@ void PropagateUploadFileV1::startNextChunk() headers[checkSumHeaderC] = _transmissionChecksumHeader; } - const QString fileName = propagator()->fullLocalPath(_fileToUpload._file); + const QString fileName = _fileToUpload._path; auto device = std::make_unique( fileName, chunkStart, currentChunkSize, &propagator()->_bandwidthManager); if (!device->open(QIODevice::ReadOnly)) {