forked from quic-go/quic-go
panic when trying to store a wrong-sized buffer in the buffer pool
This commit is contained in:
@@ -13,6 +13,10 @@ func getPacketBuffer() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func putPacketBuffer(buf []byte) {
|
func putPacketBuffer(buf []byte) {
|
||||||
|
if cap(buf) != int(protocol.MaxPacketSize) {
|
||||||
|
println(buf)
|
||||||
|
panic("putPacketBuffer called with packet of wrong size!")
|
||||||
|
}
|
||||||
bufferPool.Put(buf[:0])
|
bufferPool.Put(buf[:0])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user