aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-09 16:19:55 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-09 16:19:55 +0200
commit11404879f2e7ee02118852b6b42e19f99cb2edd9 (patch)
tree7f13340b6d28eca268ef6149aae715bce69c1c15
parent1809540dc87c665cafcd6daf514b39b4a17e483f (diff)
downloaddna-backup-11404879f2e7ee02118852b6b42e19f99cb2edd9.tar.gz
dna-backup-11404879f2e7ee02118852b6b42e19f99cb2edd9.zip
fix matchStream: encode prev if exists in epilogue
-rw-r--r--repo.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/repo.go b/repo.go
index c023568..467567d 100644
--- a/repo.go
+++ b/repo.go
@@ -454,6 +454,10 @@ func (r *Repo) matchStream(stream io.Reader, version int) []Chunk {
if len(buff) > 0 {
var temp *TempChunk
if len(buff) > r.chunkSize {
+ if prev != nil {
+ chunk, _ := r.encodeTempChunk(prev, version, &last)
+ chunks = append(chunks, chunk)
+ }
prev = NewTempChunk(buff[:r.chunkSize])
temp = NewTempChunk(buff[r.chunkSize:])
} else {