Skip to content

Commit

Permalink
fix(gateway): CAR linksystem fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aschmahmann authored and hacdias committed May 25, 2023
1 parent a44790d commit 03debb9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gateway/blocks_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ func (api *BlocksGateway) GetCAR(ctx context.Context, p ImmutablePath, params Ca

lsys := cidlink.DefaultLinkSystem()
unixfsnode.AddUnixFSReificationToLinkSystem(&lsys)
lsys.StorageReadOpener = blockOpener(ctx, blockGetter)

// TODO: support selectors passed as request param: https://github.com/ipfs/kubo/issues/8769
// TODO: this is very slow if blocks are remote due to linear traversal. Do we need deterministic traversals here?
Expand Down Expand Up @@ -304,8 +305,10 @@ func walkGatewaySimpleSelector(ctx context.Context, p ipfspath.Path, params CarP

progress := traversal.Progress{
Cfg: &traversal.Config{
Ctx: ctx,
LinkSystem: *lsys,
Ctx: ctx,
LinkSystem: *lsys,
LinkTargetNodePrototypeChooser: bsfetcher.DefaultPrototypeChooser,
LinkVisitOnlyOnce: true, // This is safe for the "all" selector
},
}

Expand Down

0 comments on commit 03debb9

Please sign in to comment.