diff options
author | n-peugnet <n.peugnet@free.fr> | 2021-09-22 16:29:12 +0200 |
---|---|---|
committer | n-peugnet <n.peugnet@free.fr> | 2021-09-22 16:38:34 +0200 |
commit | 368f89466f48e8621254b04c1bca996db5c7a66a (patch) | |
tree | 8bc5dcc6dc80dcfef9a1a05bd15a841127a303ec /repo.go | |
parent | 34a60695b43713dfe82713cdc59fb6ca35ad4757 (diff) | |
download | dna-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.go | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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 { |