Fix bug in server-side implementation of read

This commit is contained in:
Olivier 'reivilibre' 2022-01-22 11:58:49 +00:00
parent a629041387
commit e3621aacb8

View File

@ -425,7 +425,7 @@ impl FileAccess {
let mut target = vec![0u8; size as usize]; let mut target = vec![0u8; size as usize];
let mut read_so_far = 0; let mut read_so_far = 0;
while TryInto::<u64>::try_into(read_so_far)? < offset { while TryInto::<u32>::try_into(read_so_far)? < size {
let how_many_read = handle.file.read(&mut target[read_so_far..]).await?; let how_many_read = handle.file.read(&mut target[read_so_far..]).await?;
read_so_far += how_many_read; read_so_far += how_many_read;
if how_many_read == 0 { if how_many_read == 0 {