Przeglądaj źródła

fix buffer pool in quic

Darien Raymond 7 lat temu
rodzic
commit
163fe2523e

+ 2 - 1
vendor/github.com/lucas-clemente/quic-go/buffer_pool.go

@@ -36,7 +36,8 @@ func (b *packetBuffer) Release() {
 	}
 	// only put the packetBuffer back if it's not used any more
 	if b.refCount == 0 {
-		bufferPool.Put(b.Slice)
+		buffer := b.Slice[0:cap(b.Slice)]
+		bufferPool.Put(buffer)
 	}
 }