diff --git a/gateway/backend_blocks.go b/gateway/backend_blocks.go index 98cd95760..5d71a51eb 100644 --- a/gateway/backend_blocks.go +++ b/gateway/backend_blocks.go @@ -353,7 +353,7 @@ func (bb *BlocksBackend) GetCAR(ctx context.Context, p path.ImmutablePath, param // 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? - carWriteErr := walkGatewaySimpleSelectorGraph(ctx, p, params, &lsys, pathResolver) + carWriteErr := walkGatewaySimpleSelector(ctx, p, params, &lsys, pathResolver) // io.PipeWriter.CloseWithError always returns nil. _ = w.CloseWithError(carWriteErr) @@ -362,9 +362,8 @@ func (bb *BlocksBackend) GetCAR(ctx context.Context, p path.ImmutablePath, param return pathMetadata, r, nil } -// FIXME(hacdias) fix this and reuse walkGatewaySimpleSelector -// walkGatewaySimpleSelectorGraph walks the subgraph described by the path and terminal element parameters -func walkGatewaySimpleSelectorGraph(ctx context.Context, p path.ImmutablePath, params CarParams, lsys *ipld.LinkSystem, pathResolver resolver.Resolver) error { +// walkGatewaySimpleSelector walks the subgraph described by the path and terminal element parameters +func walkGatewaySimpleSelector(ctx context.Context, p path.ImmutablePath, params CarParams, lsys *ipld.LinkSystem, pathResolver resolver.Resolver) error { // First resolve the path since we always need to. lastCid, remainder, err := pathResolver.ResolveToLastNode(ctx, p) if err != nil { diff --git a/gateway/backend_graph.go b/gateway/backend_graph.go index cdaabce7e..dac3c2784 100644 --- a/gateway/backend_graph.go +++ b/gateway/backend_graph.go @@ -1194,7 +1194,7 @@ func (api *GraphGateway) GetCAR(ctx context.Context, path path.ImmutablePath, pa blockBuffer = nil } - err = walkGatewaySimpleSelector(ctx, terminalBlk, params.Scope, params.Range, l) + err = walkGatewaySimpleSelector2(ctx, terminalBlk, params.Scope, params.Range, l) if err != nil { return err } diff --git a/gateway/backend_graph_traversal.go b/gateway/backend_graph_traversal.go index 42bf2d029..8f3d46232 100644 --- a/gateway/backend_graph_traversal.go +++ b/gateway/backend_graph_traversal.go @@ -156,8 +156,8 @@ func getLinksystem(fn getBlock) *ipld.LinkSystem { return &lsys } -// walkGatewaySimpleSelector walks the subgraph described by the path and terminal element parameters -func walkGatewaySimpleSelector(ctx context.Context, terminalBlk blocks.Block, dagScope DagScope, entityRange *DagByteRange, lsys *ipld.LinkSystem) error { +// walkGatewaySimpleSelector2 walks the subgraph described by the path and terminal element parameters +func walkGatewaySimpleSelector2(ctx context.Context, terminalBlk blocks.Block, dagScope DagScope, entityRange *DagByteRange, lsys *ipld.LinkSystem) error { lctx := ipld.LinkContext{Ctx: ctx} var err error