Wire up the rsync code in the send kitten

This commit is contained in:
Kovid Goyal
2023-07-20 10:15:00 +05:30
parent 1523424458
commit 063c39ea12
3 changed files with 72 additions and 20 deletions

View File

@@ -608,9 +608,11 @@ func (r *rsync) CreateDelta(source io.Reader, signature []BlockHash) ([]Operatio
}
}
const DataSizeMultiple int = 8
func (r *rsync) CreateDiff(source io.Reader, signature []BlockHash, output io.Writer) func() error {
ans := &diff{
block_size: r.BlockSize, buffer: make([]byte, 0, (r.BlockSize * 8)),
block_size: r.BlockSize, buffer: make([]byte, 0, (r.BlockSize * DataSizeMultiple)),
hash_lookup: make(map[uint32][]BlockHash, len(signature)),
source: source, hasher: r.hasher_constructor(),
checksummer: r.checksummer_constructor(), output: output,