parent
4b3f9b1af9
commit
20c8dbd9ed
|
@ -1256,7 +1256,7 @@ func (f *sendReceiveFolder) copierRoutine(in <-chan copyBlocksState, pullChan ch
|
||||||
if len(hashesToFind) > 0 {
|
if len(hashesToFind) > 0 {
|
||||||
file, err = f.fs.Open(state.file.Name)
|
file, err = f.fs.Open(state.file.Name)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
weakHashFinder, err = weakhash.NewFinder(f.ctx, file, int(state.file.BlockSize()), hashesToFind)
|
weakHashFinder, err = weakhash.NewFinder(f.ctx, file, state.file.BlockSize(), hashesToFind)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
l.Debugln("weak hasher", err)
|
l.Debugln("weak hasher", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -722,7 +722,7 @@ func (m *model) Completion(device protocol.DeviceID, folder string) FolderComple
|
||||||
}
|
}
|
||||||
|
|
||||||
// This might might be more than it really is, because some blocks can be of a smaller size.
|
// This might might be more than it really is, because some blocks can be of a smaller size.
|
||||||
downloaded = int64(counts[ft.Name] * int(ft.BlockSize()))
|
downloaded = int64(counts[ft.Name]) * int64(ft.BlockSize())
|
||||||
|
|
||||||
fileNeed = ft.FileSize() - downloaded
|
fileNeed = ft.FileSize() - downloaded
|
||||||
if fileNeed < 0 {
|
if fileNeed < 0 {
|
||||||
|
@ -1623,7 +1623,7 @@ func (m *model) recheckFile(deviceID protocol.DeviceID, folderFs fs.Filesystem,
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
blockIndex := int(offset) / cf.BlockSize()
|
blockIndex := int(offset / int64(cf.BlockSize()))
|
||||||
if blockIndex >= len(cf.Blocks) {
|
if blockIndex >= len(cf.Blocks) {
|
||||||
l.Debugf("%v recheckFile: %s: %q / %q i=%d: block index too far", m, deviceID, folder, name, blockIndex)
|
l.Debugf("%v recheckFile: %s: %q / %q i=%d: block index too far", m, deviceID, folder, name, blockIndex)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue