Replace comments about relevancy of chunk to propagat v1 with variable name change

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-08-31 19:35:09 +08:00 committed by Matthieu Gallien
parent f46d71fdf6
commit a0c528a190
5 changed files with 10 additions and 15 deletions

View file

@ -1648,7 +1648,7 @@ SyncJournalDb::UploadInfo SyncJournalDb::getUploadInfo(const QString &file)
if (query->next().hasData) { if (query->next().hasData) {
bool ok = true; bool ok = true;
res._chunk = query->intValue(0); res._chunkUploadV1 = query->intValue(0);
res._transferid = query->int64Value(1); res._transferid = query->int64Value(1);
res._errorCount = query->intValue(2); res._errorCount = query->intValue(2);
res._size = query->int64Value(3); res._size = query->int64Value(3);
@ -1678,7 +1678,7 @@ void SyncJournalDb::setUploadInfo(const QString &file, const SyncJournalDb::Uplo
} }
query->bindValue(1, file); query->bindValue(1, file);
query->bindValue(2, i._chunk); query->bindValue(2, i._chunkUploadV1);
query->bindValue(3, i._transferid); query->bindValue(3, i._transferid);
query->bindValue(4, i._errorCount); query->bindValue(4, i._errorCount);
query->bindValue(5, i._size); query->bindValue(5, i._size);
@ -2714,13 +2714,8 @@ bool operator==(const SyncJournalDb::DownloadInfo &lhs,
bool operator==(const SyncJournalDb::UploadInfo &lhs, bool operator==(const SyncJournalDb::UploadInfo &lhs,
const SyncJournalDb::UploadInfo &rhs) const SyncJournalDb::UploadInfo &rhs)
{ {
return lhs._errorCount == rhs._errorCount return lhs._errorCount == rhs._errorCount && lhs._chunkUploadV1 == rhs._chunkUploadV1 && lhs._modtime == rhs._modtime && lhs._valid == rhs._valid
&& lhs._chunk == rhs._chunk && lhs._size == rhs._size && lhs._transferid == rhs._transferid && lhs._contentChecksum == rhs._contentChecksum;
&& lhs._modtime == rhs._modtime
&& lhs._valid == rhs._valid
&& lhs._size == rhs._size
&& lhs._transferid == rhs._transferid
&& lhs._contentChecksum == rhs._contentChecksum;
} }
QDebug& operator<<(QDebug &stream, const SyncJournalFileRecord::EncryptionStatus status) QDebug& operator<<(QDebug &stream, const SyncJournalFileRecord::EncryptionStatus status)

View file

@ -115,7 +115,7 @@ public:
}; };
struct UploadInfo struct UploadInfo
{ {
int _chunk = 0; // Relevant to PropagateUploadV1 only int _chunkUploadV1 = 0;
uint _transferid = 0; uint _transferid = 0;
qint64 _size = 0; qint64 _size = 0;
qint64 _modtime = 0; qint64 _modtime = 0;

View file

@ -140,7 +140,7 @@ void BulkPropagatorJob::doStartUpload(SyncFileItemPtr item,
// in reconcile (issue #5106) // in reconcile (issue #5106)
SyncJournalDb::UploadInfo pi; SyncJournalDb::UploadInfo pi;
pi._valid = true; pi._valid = true;
pi._chunk = 0; // Relevant to PropagateUploadV1 only pi._chunkUploadV1 = 0;
pi._transferid = 0; // We set a null transfer id because it is not chunked. pi._transferid = 0; // We set a null transfer id because it is not chunked.
pi._modtime = item->_modtime; pi._modtime = item->_modtime;
pi._errorCount = 0; pi._errorCount = 0;

View file

@ -53,7 +53,7 @@ void PropagateUploadFileV1::doStartUpload()
} }
if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime && progressInfo._size == _item->_size if (progressInfo._valid && progressInfo.isChunked() && progressInfo._modtime == _item->_modtime && progressInfo._size == _item->_size
&& (progressInfo._contentChecksum == _item->_checksumHeader || progressInfo._contentChecksum.isEmpty() || _item->_checksumHeader.isEmpty())) { && (progressInfo._contentChecksum == _item->_checksumHeader || progressInfo._contentChecksum.isEmpty() || _item->_checksumHeader.isEmpty())) {
_startChunk = progressInfo._chunk; _startChunk = progressInfo._chunkUploadV1;
_transferId = progressInfo._transferid; _transferId = progressInfo._transferid;
qCInfo(lcPropagateUploadV1) << _item->_file << ": Resuming from chunk " << _startChunk; qCInfo(lcPropagateUploadV1) << _item->_file << ": Resuming from chunk " << _startChunk;
} else if (_chunkCount <= 1 && !_item->_checksumHeader.isEmpty()) { } else if (_chunkCount <= 1 && !_item->_checksumHeader.isEmpty()) {
@ -62,7 +62,7 @@ void PropagateUploadFileV1::doStartUpload()
// in reconcile (issue #5106) // in reconcile (issue #5106)
SyncJournalDb::UploadInfo pi; SyncJournalDb::UploadInfo pi;
pi._valid = true; pi._valid = true;
pi._chunk = 0; pi._chunkUploadV1 = 0;
pi._transferid = 0; // We set a null transfer id because it is not chunked. pi._transferid = 0; // We set a null transfer id because it is not chunked.
Q_ASSERT(_item->_modtime > 0); Q_ASSERT(_item->_modtime > 0);
if (_item->_modtime <= 0) { if (_item->_modtime <= 0) {
@ -297,7 +297,7 @@ void PropagateUploadFileV1::slotPutFinished()
currentChunk = qMin(currentChunk, putJob->_chunk - 1); currentChunk = qMin(currentChunk, putJob->_chunk - 1);
} }
} }
pi._chunk = (currentChunk + _startChunk + 1) % _chunkCount; // next chunk to start with pi._chunkUploadV1 = (currentChunk + _startChunk + 1) % _chunkCount; // next chunk to start with
pi._transferid = _transferId; pi._transferid = _transferId;
Q_ASSERT(_item->_modtime > 0); Q_ASSERT(_item->_modtime > 0);
if (_item->_modtime <= 0) { if (_item->_modtime <= 0) {

View file

@ -153,7 +153,7 @@ private slots:
QVERIFY(!record._valid); QVERIFY(!record._valid);
record._errorCount = 5; record._errorCount = 5;
record._chunk = 12; record._chunkUploadV1 = 12;
record._transferid = 812974891; record._transferid = 812974891;
record._size = 12894789147; record._size = 12894789147;
record._modtime = dropMsecs(QDateTime::currentDateTime()); record._modtime = dropMsecs(QDateTime::currentDateTime());