mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 20:37:53 +08:00
Merge pull request #5258 from ipfs/fix/5247
when sending blocks in bitswap, close streams asynchronously
This commit is contained in:
commit
6f140d2579
@ -123,9 +123,10 @@ func (bsnet *impl) SendMessage(
|
||||
s.Reset()
|
||||
return err
|
||||
}
|
||||
// Yes, return this error. We have no reason to believe that the block
|
||||
// was actually *sent* unless we see the EOF.
|
||||
return inet.FullClose(s)
|
||||
// TODO(https://github.com/libp2p/go-libp2p-net/issues/28): Avoid this goroutine.
|
||||
go inet.AwaitEOF(s)
|
||||
return s.Close()
|
||||
|
||||
}
|
||||
|
||||
func (bsnet *impl) SetDelegate(r Receiver) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user