mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
refactor
This commit is contained in:
parent
cee2fe4b6f
commit
6361ea3188
@ -40,8 +40,7 @@ func (v *BufferedReader) Read(b []byte) (int, error) {
|
|||||||
return v.reader.Read(b)
|
return v.reader.Read(b)
|
||||||
}
|
}
|
||||||
if v.buffer.IsEmpty() {
|
if v.buffer.IsEmpty() {
|
||||||
err := v.buffer.AppendSupplier(ReadFrom(v.reader))
|
if err := v.buffer.Reset(ReadFrom(v.reader)); err != nil {
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,8 +28,7 @@ func (v *BufferedWriter) Write(b []byte) (int, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if v.buffer.IsFull() {
|
if v.buffer.IsFull() {
|
||||||
err := v.Flush()
|
if err := v.Flush(); err != nil {
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
if nBytes < len(b) {
|
if nBytes < len(b) {
|
||||||
|
Loading…
Reference in New Issue
Block a user