mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-01-02 07:25:19 -05:00
also resize value when error
This commit is contained in:
@@ -190,9 +190,7 @@ func (b *Buffer) FillFrom(reader io.Reader) (int, error) {
|
||||
begin := b.Len()
|
||||
b.Value = b.Value[:cap(b.Value)]
|
||||
nBytes, err := reader.Read(b.Value[begin:])
|
||||
if err == nil {
|
||||
b.Value = b.Value[:begin+nBytes]
|
||||
}
|
||||
b.Value = b.Value[:begin+nBytes]
|
||||
return nBytes, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user