mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-30 18:13:54 +08:00
Buffer response channel to prevent deadlock
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -119,7 +119,7 @@ type interestReq struct {
|
|||||||
// block we received) this function will not be called, as the cid will likely
|
// block we received) this function will not be called, as the cid will likely
|
||||||
// still be in the interest cache.
|
// still be in the interest cache.
|
||||||
func (s *Session) isLiveWant(c *cid.Cid) bool {
|
func (s *Session) isLiveWant(c *cid.Cid) bool {
|
||||||
resp := make(chan bool)
|
resp := make(chan bool, 1)
|
||||||
s.interestReqs <- interestReq{
|
s.interestReqs <- interestReq{
|
||||||
c: c,
|
c: c,
|
||||||
resp: resp,
|
resp: resp,
|
||||||
|
Reference in New Issue
Block a user