aboutsummaryrefslogtreecommitdiff
path: root/repo.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-22 16:29:12 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-22 16:38:34 +0200
commit368f89466f48e8621254b04c1bca996db5c7a66a (patch)
tree8bc5dcc6dc80dcfef9a1a05bd15a841127a303ec /repo.go
parent34a60695b43713dfe82713cdc59fb6ca35ad4757 (diff)
downloaddna-backup-368f89466f48e8621254b04c1bca996db5c7a66a.tar.gz
dna-backup-368f89466f48e8621254b04c1bca996db5c7a66a.zip
trying to fix the mystical bug
If prev is not null and no match if found, always encode both remaining chunks. Previously some chunks of chunkSize could have been stored as TempChunks in the recipe instead of as StoredChunks with hashes and an Id. This did not fix the mystical bug. But it helped finding where it came from.
Diffstat (limited to 'repo.go')
-rw-r--r--repo.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/repo.go b/repo.go
index 0d7ea65..4761c49 100644
--- a/repo.go
+++ b/repo.go
@@ -577,14 +577,11 @@ func (r *Repo) encodeTempChunks(prev BufferedChunk, curr BufferedChunk, version
c, success := r.encodeTempChunk(tmp, version, last, storeQueue)
if success {
return []Chunk{c}
- } else {
- return []Chunk{prev, curr}
}
- } else {
- prevD, _ := r.encodeTempChunk(prev, version, last, storeQueue)
- currD, _ := r.encodeTempChunk(curr, version, last, storeQueue)
- return []Chunk{prevD, currD}
}
+ prevD, _ := r.encodeTempChunk(prev, version, last, storeQueue)
+ currD, _ := r.encodeTempChunk(curr, version, last, storeQueue)
+ return []Chunk{prevD, currD}
}
func (r *Repo) matchStream(stream io.Reader, version int) []Chunk {