1
0
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:
Jeromy
2017-11-12 19:21:56 -08:00
parent 40533eda5e
commit 332891f7b2

View File

@ -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,