Skip to content

Commit

Permalink
fix(bitswap/network): return when context is done
Browse files Browse the repository at this point in the history
@jbenet @whyrusleeping

This bug (missing return) could tie up the client worker and cause
operations to come to a halt.
  • Loading branch information
Brian Tiger Chow committed Jan 3, 2015
1 parent 85833dc commit 4e50a54
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions exchange/bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
}
}
Expand Down

0 comments on commit 4e50a54

Please sign in to comment.