From 09e3cdfebf0a8913c2742bcbde6d1beee3fc7e0d Mon Sep 17 00:00:00 2001 From: Gilbert Chen Date: Mon, 8 Jun 2020 10:53:01 -0400 Subject: [PATCH] Ignore 0-byte chunks passed in by the chunk reader. The fixed-size chunk reader may create 0-byte chunks from empty files. This may cause validation errors when preparing the snapshot file as the last step of a backup. --- src/duplicacy_backupmanager.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/duplicacy_backupmanager.go b/src/duplicacy_backupmanager.go index 2e5a908..1827d7f 100644 --- a/src/duplicacy_backupmanager.go +++ b/src/duplicacy_backupmanager.go @@ -520,6 +520,11 @@ func (manager *BackupManager) Backup(top string, quickMode bool, threads int, ta chunkID := chunk.GetID() chunkSize := chunk.GetLength() + if chunkSize == 0 { + LOG_DEBUG("CHUNK_EMPTY", "Ignored chunk %s of size 0", chunkID) + return + } + chunkIndex++ _, found := chunkCache[chunkID]