mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 11:11:47 +02:00
More work on porting the receive kitten
This commit is contained in:
@@ -195,6 +195,7 @@ type rsync struct {
|
||||
hasher_constructor func() hash.Hash64
|
||||
checksummer_constructor func() hash.Hash
|
||||
checksummer hash.Hash
|
||||
checksum_done bool
|
||||
buffer []byte
|
||||
}
|
||||
|
||||
@@ -319,6 +320,7 @@ func (r *rsync) ApplyDelta(alignedTarget io.Writer, target io.ReadSeeker, op Ope
|
||||
if !bytes.Equal(actual, op.Data) {
|
||||
return fmt.Errorf("Failed to verify overall file checksum actual: %s != expected: %s. This usually happens if some data was corrupted in transit or one of the involved files was altered while the transfer was in progress.", hex.EncodeToString(actual), hex.EncodeToString(op.Data))
|
||||
}
|
||||
r.checksum_done = true
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -185,6 +185,9 @@ func (self *Patcher) FinishDelta() (err error) {
|
||||
self.delta_input = nil
|
||||
self.delta_output = nil
|
||||
self.unconsumed_delta_data = nil
|
||||
if !self.rsync.checksum_done {
|
||||
return fmt.Errorf("The checksum was not received at the end of the delta data")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user