1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 23:53:19 +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:
Steven Allen
2018-03-07 18:30:00 -08:00
committed by Jakub Sztandera
parent d6589e5e1c
commit 4002f97724

View File

@ -181,6 +181,11 @@ func (dr *PBDagReader) CtxReadFull(ctx context.Context, b []byte) (int, error) {
return total, nil
}
// We haven't hit the end yet.
if err != io.EOF {
continue
}
// Otherwise, load up the next block
err = dr.precalcNextBuf(ctx)
if err != nil {