New Disco algortihm: Fix TestChunkingNG::connectionDroppedBeforeEtagRecieved

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
This commit is contained in:
Olivier Goffart 2018-07-18 12:40:22 +02:00 committed by Kevin Ottens
parent 710934bdbd
commit 370923791d
No known key found for this signature in database
GPG key ID: 074BBBCB8DECC9E2
2 changed files with 4 additions and 1 deletions

View file

@ -669,6 +669,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
if (up._valid && up._contentChecksum == remoteChecksumHeader) {
// Solve the conflict into an upload, or nothing
item->_instruction = up._modtime == localEntry.modtime ? CSYNC_INSTRUCTION_UPDATE_METADATA : CSYNC_INSTRUCTION_SYNC;
item->_direction = SyncFileItem::Up;
// Update the etag and other server metadata in the journal already
// (We can't use a typical CSYNC_INSTRUCTION_UPDATE_METADATA because
@ -687,6 +688,7 @@ void ProcessDirectoryJob::processFile(PathTuple path,
}
} else {
item->_instruction = CSYNC_INSTRUCTION_CONFLICT;
item->_direction = SyncFileItem::None;
}
} else {
// If the size or mtime is different, it's definitely a conflict.
@ -701,9 +703,9 @@ void ProcessDirectoryJob::processFile(PathTuple path,
// sizes and mtimes pops up when the local database is lost for
// whatever reason.
item->_instruction = isConflict ? CSYNC_INSTRUCTION_CONFLICT : CSYNC_INSTRUCTION_UPDATE_METADATA;
item->_direction = isConflict ? SyncFileItem::None : SyncFileItem::Down;
}
}
item->_direction = item->_instruction == CSYNC_INSTRUCTION_CONFLICT ? SyncFileItem::None : SyncFileItem::Down;
if (dbEntry._type == ItemTypeVirtualFile)
item->_type = ItemTypeVirtualFileDownload;
if (item->_file.endsWith(_discoveryData->_syncOptions._virtualFileSuffix)) {

View file

@ -418,6 +418,7 @@ void PropagateUploadFileCommon::slotStartUpload(const QByteArray &transmissionCh
}
quint64 fileSize = FileSystem::getSize(fullFilePath);
_item->_size = fileSize;
_fileToUpload._size = fileSize;
// But skip the file if the mtime is too close to 'now'!