Skip to content

Commit

Permalink
Fix issue ipfs/kubo#7190
Browse files Browse the repository at this point in the history
  • Loading branch information
ellttBen committed May 28, 2020
1 parent 68c015a commit 2a5b722
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions io/dagreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@ func (dr *dagReader) CtxReadFull(ctx context.Context, out []byte) (n int, err er
// Output buffer full, no need to keep traversing the DAG,
// signal the `Walker` to pause the iteration.
dr.dagWalker.Pause()

} else if len(node.Links()) > 0 {
if len(node.Links()[0].Name) != 0 {
// This indicates that the node contains only named links,
// because empty string links always come before named ones.
// Incidentally, this means that the node's data is contained within
// its data attribute, which has already been read at this point.
// Therefore, we return an EOF signal.

return ipld.EndOfDag
}
}

return nil
Expand Down

0 comments on commit 2a5b722

Please sign in to comment.