mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -05:00
release buffer if payload becomes small
This commit is contained in:
parent
feb421d9e1
commit
b2d9364cb5
@ -47,6 +47,9 @@ func (r *BytesToBufferReader) ReadMultiBuffer() (MultiBuffer, error) {
|
||||
if nBytes == len(r.buffer) && nBytes < xlSize {
|
||||
freeBytes(r.buffer)
|
||||
r.buffer = newBytes(uint32(nBytes) + 1)
|
||||
} else if nBytes < Size {
|
||||
freeBytes(r.buffer)
|
||||
r.buffer = nil
|
||||
}
|
||||
return mb, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user