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) {
|
||||
if cap(*buf) < int(protocol.MaxReceivePacketSize) {
|
||||
panic("putPacketBuffer called with packet of wrong size!")
|
||||
b := *buf
|
||||
if cap(b) < 2048 {
|
||||
return
|
||||
}
|
||||
bufferPool.Put(*buf)
|
||||
bufferPool.Put(b[:cap(b)])
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Loading…
Reference in New Issue