Skip to content

Commit fa45f32

Browse files
committed
bug fix for #82
1 parent f718802 commit fa45f32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stream.go

+6
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ func (s *Stream) waitRead() error {
272272
case <-s.chReadEvent:
273273
return nil
274274
case <-s.chFinEvent:
275+
// BUG(xtaci): Fix for https://github.com/xtaci/smux/issues/82
276+
s.bufferLock.Lock()
277+
defer s.bufferLock.Unlock()
278+
if len(s.buffers) > 0 {
279+
return nil
280+
}
275281
return io.EOF
276282
case <-s.sess.chSocketReadError:
277283
return s.sess.socketReadError.Load().(error)

0 commit comments

Comments
 (0)