1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-12 14:23:30 +00:00

Verify chunk id for snapshot chunks

This commit is contained in:
Gilbert Chen
2017-07-07 12:08:38 -04:00
parent 2908b807b9
commit 09f695b3e1
3 changed files with 20 additions and 1 deletions

View File

@@ -92,6 +92,11 @@ func (uploader *ChunkUploader) Upload(threadIndex int, task ChunkUploadTask) boo
chunkSize := chunk.GetLength()
chunkID := chunk.GetID()
// For a snapshot chunk, verify that its chunk id is correct
if uploader.snapshotCache != nil {
chunk.VerifyID()
}
if uploader.snapshotCache != nil && uploader.storage.IsCacheNeeded() {
// Save a copy to the local snapshot.
chunkPath, exist, _, err := uploader.snapshotCache.FindChunk(threadIndex, chunkID, false)