mirror of https://github.com/v2ray/v2ray-core
flush when not buffered
parent
f3ba1dbb8c
commit
743d35c059
|
@ -67,13 +67,14 @@ func (w *BufferedWriter) Write(b []byte) (int, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return totalBytes, err
|
return totalBytes, err
|
||||||
}
|
}
|
||||||
if w.buffer.IsFull() {
|
if !w.buffered || w.buffer.IsFull() {
|
||||||
if err := w.Flush(); err != nil {
|
if err := w.Flush(); err != nil {
|
||||||
return totalBytes, err
|
return totalBytes, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
b = b[nBytes:]
|
b = b[nBytes:]
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalBytes, nil
|
return totalBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue