From e99dd2994623668b4105a9c4d70a7f84ab7e0a04 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Wed, 21 Nov 2018 11:03:47 +0100 Subject: [PATCH] update putPacketBuffer --- vendor/github.com/lucas-clemente/quic-go/buffer_pool.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vendor/github.com/lucas-clemente/quic-go/buffer_pool.go b/vendor/github.com/lucas-clemente/quic-go/buffer_pool.go index a5fd38ca..d7bfea59 100644 --- a/vendor/github.com/lucas-clemente/quic-go/buffer_pool.go +++ b/vendor/github.com/lucas-clemente/quic-go/buffer_pool.go @@ -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() {