提交 05d8c80c 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

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.
上级 64cb32da
......@@ -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:
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论