mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-28 08:47:42 +08:00
don't assume that Read reads all available bytes in pbdagreader
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:

committed by
Jakub Sztandera

parent
d6589e5e1c
commit
4002f97724
@ -181,6 +181,11 @@ func (dr *PBDagReader) CtxReadFull(ctx context.Context, b []byte) (int, error) {
|
|||||||
return total, nil
|
return total, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We haven't hit the end yet.
|
||||||
|
if err != io.EOF {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Otherwise, load up the next block
|
// Otherwise, load up the next block
|
||||||
err = dr.precalcNextBuf(ctx)
|
err = dr.precalcNextBuf(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user