Skip to content

Commit

Permalink
Merge pull request #5258 from ipfs/fix/5247
Browse files Browse the repository at this point in the history
when sending blocks in bitswap, close streams asynchronously
  • Loading branch information
whyrusleeping authored Jul 18, 2018
2 parents 256ad27 + 3e30658 commit 6f140d2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions exchange/bitswap/network/ipfs_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6f140d2

Please sign in to comment.