use QByteArray::left to send the newly received data during hydration
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 6 Aug 2024 14:39:41 +0000 (16:39 +0200)
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>
Tue, 6 Aug 2024 16:17:04 +0000 (18:17 +0200)
we use the proper method from QByteArray to forward the data received by
GETFileJob to the socket connected to teh fetch data CfApi callback

Close https://github.com/nextcloud/desktop/issues/6769

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
src/libsync/propagatedownload.cpp

index a36a11ccd4992db8f1b3fbca63b21d1378e92686..417f6bedc894332ca994d21ea664d9151b0ed2d8 100644 (file)
@@ -318,7 +318,7 @@ void GETFileJob::slotReadyRead()
             return;
         }
 
-        const qint64 writtenBytes = writeToDevice(QByteArray::fromRawData(buffer.constData(), readBytes));
+        const qint64 writtenBytes = writeToDevice(buffer.left(readBytes));
         if (writtenBytes != readBytes) {
             _errorString = _device->errorString();
             _errorStatus = SyncFileItem::NormalError;