Skip to content

Commit 6f140d2

Browse files
Merge pull request #5258 from ipfs/fix/5247
when sending blocks in bitswap, close streams asynchronously
2 parents 256ad27 + 3e30658 commit 6f140d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exchange/bitswap/network/ipfs_impl.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,10 @@ func (bsnet *impl) SendMessage(
123123
s.Reset()
124124
return err
125125
}
126-
// Yes, return this error. We have no reason to believe that the block
127-
// was actually *sent* unless we see the EOF.
128-
return inet.FullClose(s)
126+
// TODO(https://github.com/libp2p/go-libp2p-net/issues/28): Avoid this goroutine.
127+
go inet.AwaitEOF(s)
128+
return s.Close()
129+
129130
}
130131

131132
func (bsnet *impl) SetDelegate(r Receiver) {

0 commit comments

Comments
 (0)