diff --git a/core/corehttp/routing.go b/core/corehttp/routing.go index 9d1c3248ba3e..5367fe826857 100644 --- a/core/corehttp/routing.go +++ b/core/corehttp/routing.go @@ -16,11 +16,6 @@ import ( "github.com/multiformats/go-multiaddr" ) -const ( - streamingProvidersCount = 0 - nonStreamingProvidersCount = 20 -) - func RoutingOption() ServeOption { return func(n *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) { handler := server.Handler(&contentRouter{n}) @@ -33,13 +28,9 @@ type contentRouter struct { n *core.IpfsNode } -func (r *contentRouter) FindProviders(ctx context.Context, key cid.Cid, streaming bool) (iter.ResultIter[types.ProviderResponse], error) { +func (r *contentRouter) FindProviders(ctx context.Context, key cid.Cid, limit int) (iter.ResultIter[types.ProviderResponse], error) { ctx, cancel := context.WithCancel(ctx) - count := nonStreamingProvidersCount - if streaming { - count = streamingProvidersCount - } - ch := r.n.Routing.FindProvidersAsync(ctx, key, count) + ch := r.n.Routing.FindProvidersAsync(ctx, key, limit) return iter.ToResultIter[types.ProviderResponse](&peerChanIter{ ch: ch, cancel: cancel, diff --git a/docs/examples/kubo-as-a-library/go.mod b/docs/examples/kubo-as-a-library/go.mod index 23fcff328e24..6a3041e6744e 100644 --- a/docs/examples/kubo-as-a-library/go.mod +++ b/docs/examples/kubo-as-a-library/go.mod @@ -7,7 +7,7 @@ go 1.18 replace github.com/ipfs/kubo => ./../../.. require ( - github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44 + github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8 github.com/ipfs/kubo v0.0.0-00010101000000-000000000000 github.com/libp2p/go-libp2p v0.27.3 github.com/multiformats/go-multiaddr v0.9.0 diff --git a/docs/examples/kubo-as-a-library/go.sum b/docs/examples/kubo-as-a-library/go.sum index f503ff40672c..2741c9e7a6c0 100644 --- a/docs/examples/kubo-as-a-library/go.sum +++ b/docs/examples/kubo-as-a-library/go.sum @@ -321,8 +321,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44 h1:C5U/SZW51/AiY3t4dgC0BWvP/4U5v5zgrHIWS7N5OeM= -github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44/go.mod h1:Ej2r08Z4VIaFKqY08UXMNhwcLf6VekHhK8c+KqA1B9Y= +github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8 h1:aJGuLI/MDQh5Ziw70wfFPGZB5yN0Y+NEfb3pUwEV2oY= +github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8/go.mod h1:Ej2r08Z4VIaFKqY08UXMNhwcLf6VekHhK8c+KqA1B9Y= github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= diff --git a/go.mod b/go.mod index 396e00f123fd..6a03496926df 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/google/uuid v1.3.0 github.com/hashicorp/go-multierror v1.1.1 - github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44 + github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8 github.com/ipfs/go-block-format v0.1.2 github.com/ipfs/go-cid v0.4.1 github.com/ipfs/go-cidutil v0.1.0 diff --git a/go.sum b/go.sum index bd8cbe004d7c..b8b62fec8dae 100644 --- a/go.sum +++ b/go.sum @@ -356,8 +356,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1: github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/ipfs/bbloom v0.0.4 h1:Gi+8EGJ2y5qiD5FbsbpX/TMNcJw8gSqr7eyjHa4Fhvs= github.com/ipfs/bbloom v0.0.4/go.mod h1:cS9YprKXpoZ9lT0n/Mw/a6/aFV6DTjTLYHeA+gyqMG0= -github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44 h1:C5U/SZW51/AiY3t4dgC0BWvP/4U5v5zgrHIWS7N5OeM= -github.com/ipfs/boxo v0.8.2-0.20230515105410-d96e912ecb44/go.mod h1:Ej2r08Z4VIaFKqY08UXMNhwcLf6VekHhK8c+KqA1B9Y= +github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8 h1:aJGuLI/MDQh5Ziw70wfFPGZB5yN0Y+NEfb3pUwEV2oY= +github.com/ipfs/boxo v0.8.2-0.20230524101241-06f2d96c75c8/go.mod h1:Ej2r08Z4VIaFKqY08UXMNhwcLf6VekHhK8c+KqA1B9Y= github.com/ipfs/go-bitfield v1.1.0 h1:fh7FIo8bSwaJEh6DdTWbCeZ1eqOaOkKFI74SCnsWbGA= github.com/ipfs/go-bitfield v1.1.0/go.mod h1:paqf1wjq/D2BBmzfTVFlJQ9IlFOZpg422HL0HqsGWHU= github.com/ipfs/go-block-format v0.0.2/go.mod h1:AWR46JfpcObNfg3ok2JHDUfdiHRgWhJgCQF+KIgOPJY= diff --git a/test/cli/content_routing_http_test.go b/test/cli/content_routing_http_test.go index f48f655d9c8f..c1ea64d3fb58 100644 --- a/test/cli/content_routing_http_test.go +++ b/test/cli/content_routing_http_test.go @@ -24,7 +24,7 @@ type fakeHTTPContentRouter struct { provideCalls int } -func (r *fakeHTTPContentRouter) FindProviders(ctx context.Context, key cid.Cid, stream bool) (iter.ResultIter[types.ProviderResponse], error) { +func (r *fakeHTTPContentRouter) FindProviders(ctx context.Context, key cid.Cid, limit int) (iter.ResultIter[types.ProviderResponse], error) { r.m.Lock() defer r.m.Unlock() r.findProvidersCalls++