Skip to content

Commit

Permalink
OpenStream should return false if read has error issue#61
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Jan 20, 2020
1 parent 6da22a1 commit 292d504
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ func (s *Session) OpenStream() (*Stream, error) {
s.streamLock.Lock()
defer s.streamLock.Unlock()
select {
case <-s.chSocketReadError:
return nil, s.socketReadError.Load().(error)
case <-s.chSocketWriteError:
return nil, s.socketWriteError.Load().(error)
case <-s.die:
Expand Down

0 comments on commit 292d504

Please sign in to comment.