1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-07-26 11:44:22 -04:00

return error in SetBuffered

This commit is contained in:
Darien Raymond 2017-01-06 11:40:35 +01:00
parent 762afc1d8f
commit 06a73adb1e
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -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
}