Browse Source

fix race condition in stream writing

v2ray 9 năm trước cách đây
mục cha
commit
1732d33ba9
1 tập tin đã thay đổi với 3 bổ sung0 xóa
  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
 	}