Skip to content

Commit

Permalink
Merge pull request #1148 from godcongdev/master
Browse files Browse the repository at this point in the history
fix(basic_host): stream not closed when context done
  • Loading branch information
Stebalien authored Aug 3, 2021
2 parents 93ad759 + 99c48cf commit aaef2e0
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 aaef2e0

Please sign in to comment.