1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00
This commit is contained in:
Darien Raymond 2017-04-18 12:41:36 +02:00
parent cee2fe4b6f
commit 6361ea3188
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 2 additions and 4 deletions

View File

@ -40,8 +40,7 @@ func (v *BufferedReader) Read(b []byte) (int, error) {
return v.reader.Read(b)
}
if v.buffer.IsEmpty() {
err := v.buffer.AppendSupplier(ReadFrom(v.reader))
if err != nil {
if err := v.buffer.Reset(ReadFrom(v.reader)); err != nil {
return 0, err
}
}

View File

@ -28,8 +28,7 @@ func (v *BufferedWriter) Write(b []byte) (int, error) {
return 0, err
}
if v.buffer.IsFull() {
err := v.Flush()
if err != nil {
if err := v.Flush(); err != nil {
return 0, err
}
if nBytes < len(b) {