Parcourir la source

Prevent Read on a closed stream

Armon Dadgar il y a 10 ans
Parent
commit
912e29616f
1 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 2 0
      stream.go

+ 2 - 0
stream.go

@@ -86,6 +86,8 @@ func (s *Stream) Read(b []byte) (n int, err error) {
 START:
 	s.stateLock.Lock()
 	switch s.state {
+	case streamLocalClose:
+		fallthrough
 	case streamRemoteClose:
 		fallthrough
 	case streamClosed: