mirror of https://github.com/v2ray/v2ray-core
update putPacketBuffer
parent
649f4da92a
commit
e99dd29946
|
@ -16,10 +16,11 @@ func getPacketBuffer() *[]byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
func putPacketBuffer(buf *[]byte) {
|
func putPacketBuffer(buf *[]byte) {
|
||||||
if cap(*buf) < int(protocol.MaxReceivePacketSize) {
|
b := *buf
|
||||||
panic("putPacketBuffer called with packet of wrong size!")
|
if cap(b) < 2048 {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
bufferPool.Put(*buf)
|
bufferPool.Put(b[:cap(b)])
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
Loading…
Reference in New Issue