浏览代码

Prevent Read on a closed stream

Armon Dadgar 10 年之前
父节点
当前提交
912e29616f
共有 1 个文件被更改,包括 2 次插入0 次删除
  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: