Skip to content

Commit

Permalink
bug fix for #82
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Nov 25, 2020
1 parent f718802 commit fa45f32
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ func (s *Stream) waitRead() error {
case <-s.chReadEvent:
return nil
case <-s.chFinEvent:
// BUG(xtaci): Fix for https://github.com/xtaci/smux/issues/82
s.bufferLock.Lock()
defer s.bufferLock.Unlock()
if len(s.buffers) > 0 {
return nil
}
return io.EOF
case <-s.sess.chSocketReadError:
return s.sess.socketReadError.Load().(error)
Expand Down

0 comments on commit fa45f32

Please sign in to comment.