mirror of https://github.com/v2ray/v2ray-core
Fix dead lock in buffered writer
parent
ec610494ea
commit
e00c424341
|
@ -35,10 +35,7 @@ func (this *BufferedWriter) Write(b []byte) (int, error) {
|
||||||
}
|
}
|
||||||
nBytes, _ := this.buffer.Write(b)
|
nBytes, _ := this.buffer.Write(b)
|
||||||
if this.buffer.IsFull() {
|
if this.buffer.IsFull() {
|
||||||
err := this.Flush()
|
go this.Flush()
|
||||||
if err != nil {
|
|
||||||
return nBytes, err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return nBytes, nil
|
return nBytes, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue