1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 15:42:21 +08:00

take offset into account for computing read size

This commit is contained in:
Jeromy
2015-03-06 11:07:09 -08:00
parent 4e7140dd0f
commit da47c218b7

View File

@ -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