mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-26 07:28:20 +08:00
take offset into account for computing read size
This commit is contained in:
@ -170,7 +170,7 @@ func (s *Node) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadR
|
||||
return err
|
||||
}
|
||||
|
||||
buf := resp.Data[:min(req.Size, int(r.Size()))]
|
||||
buf := resp.Data[:min(req.Size, int(r.Size()-req.Offset))]
|
||||
n, err := io.ReadFull(r, buf)
|
||||
if err != nil && err != io.EOF {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user