From 05d8c80c394353a29f4caadcfa11b01fd43d3c9d Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Sat, 3 Jan 2015 17:15:05 -0500 Subject: [PATCH] fix(bitswap/network): return when context is done @jbenet @whyrusleeping This bug (missing return) could tie up the client worker and cause operations to come to a halt. --- exchange/bitswap/network/ipfs_impl.go | 1 + 1 file changed, 1 insertion(+) diff --git a/exchange/bitswap/network/ipfs_impl.go b/exchange/bitswap/network/ipfs_impl.go index 0950ed0b8..841688162 100644 --- a/exchange/bitswap/network/ipfs_impl.go +++ b/exchange/bitswap/network/ipfs_impl.go @@ -107,6 +107,7 @@ func (bsnet *impl) FindProvidersAsync(ctx context.Context, k util.Key, max int) bsnet.host.Peerstore().AddAddresses(info.ID, info.Addrs) select { case <-ctx.Done(): + return case out <- info.ID: } }