Skip to content

Commit

Permalink
Ignore 0-byte chunks passed in by the chunk reader.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gilbertchen committed Jun 8, 2020
1 parent fe854d4 commit 09e3cdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/duplicacy_backupmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

1 comment on commit 09e3cdf

@gilbertchen
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Duplicacy Forum. There might be relevant details there:

https://forum.duplicacy.com/t/cli-release-2-6-0-is-now-available/3912/1

Please sign in to comment.