mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-20 07:04:08 +00:00
return error in SetBuffered
This commit is contained in:
1 file changed
+3
-2
@@ -84,9 +84,10 @@ func (v *BufferedWriter) IsBuffered() bool {
|
||||
}
|
||||
|
||||
// SetBuffered controls whether the BufferedWriter holds a buffer for writing. If not buffered, any write() calls into underlying writer directly.
|
||||
func (v *BufferedWriter) SetBuffered(cached bool) {
|
||||
func (v *BufferedWriter) SetBuffered(cached bool) error {
|
||||
v.buffered = cached
|
||||
if !cached && !v.buffer.IsEmpty() {
|
||||
v.Flush()
|
||||
return v.Flush()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user