Skip to content

Commit

Permalink
fix(basic_host): stream not closed when context done
Browse files Browse the repository at this point in the history
  • Loading branch information
godcong committed Aug 3, 2021
1 parent 93ad759 commit 99c48cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@ func (h *BasicHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.I
select {
case <-h.ids.IdentifyWait(s.Conn()):
case <-ctx.Done():
_ = s.Reset()
return nil, ctx.Err()
}

Expand Down

0 comments on commit 99c48cf

Please sign in to comment.