浏览代码

fix race condition in stream writing

v2ray 9 年之前
父节点
当前提交
1732d33ba9
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      transport/ray/direct.go

+ 3 - 0
transport/ray/direct.go

@@ -77,6 +77,9 @@ func (this *Stream) Write(data *alloc.Buffer) error {
 	}
 	this.access.RLock()
 	defer this.access.RUnlock()
+	if this.closed {
+		return io.EOF
+	}
 	if this.buffer == nil {
 		return io.EOF
 	}