Skip to content

Commit ae8826b

Browse files
StebalienKubuxu
authored andcommitted
don't assume that Read reads all available bytes in pbdagreader
License: MIT Signed-off-by: Steven Allen <[email protected]>
1 parent 074bb1c commit ae8826b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unixfs/io/pbdagreader.go

+5
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,11 @@ func (dr *PBDagReader) CtxReadFull(ctx context.Context, b []byte) (int, error) {
181181
return total, nil
182182
}
183183

184+
// We haven't hit the end yet.
185+
if err != io.EOF {
186+
continue
187+
}
188+
184189
// Otherwise, load up the next block
185190
err = dr.precalcNextBuf(ctx)
186191
if err != nil {

0 commit comments

Comments
 (0)