1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-01 06:55:25 -05:00

refine buffer allocation

This commit is contained in:
Darien Raymond
2018-03-11 23:06:04 +01:00
parent 5eac607087
commit f97e6fa3d2
7 changed files with 72 additions and 74 deletions

View File

@@ -81,7 +81,7 @@ func (v *ChunkReader) ReadMultiBuffer() (buf.MultiBuffer, error) {
if length > buf.Size {
// Theoretically the size of a chunk is 64K, but most Shadowsocks implementations used <4K buffer.
buffer.Release()
buffer = buf.NewLocal(int(length) + 128)
buffer = buf.NewLocal(uint32(length) + 128)
}
buffer.Clear()