Merge pull request #5258 from ipfs/fix/5247

when sending blocks in bitswap, close streams asynchronously
This commit is contained in:
Whyrusleeping 2018-07-18 14:28:29 -05:00 committed by GitHub
commit 6f140d2579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) {