mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-13 22:45:13 +00:00
fix race condition in stream writing
This commit is contained in:
1 parent
1f99b769ba
commit
1732d33ba9
1 file changed
+3
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user