Add pools for packetack

This commit is contained in:
9seconds
2020-03-23 17:08:13 +03:00
parent 6449109b2b
commit 9125a29e79
4 changed files with 46 additions and 5 deletions
+3 -1
View File
@@ -88,7 +88,9 @@ func (w *wrapperClientAbridged) Write(packet conntypes.Packet, acks *conntypes.C
return nil
case packetLength < clientAbridgedLargePacketLength:
length24 := utils.ToUint24(uint32(packetLength))
buf := bytes.Buffer{}
buf := acquireClientBytesBuffer()
defer releaseClientBytesBuffer(buf)
buf.WriteByte(byte(clientAbridgedSmallPacketLength))
buf.Write(length24[:])