simplify content storage in packed packets

It's not necessary to store both the packetBuffer and the slice
containing the raw data in the packet.
This commit is contained in:
Marten Seemann
2020-02-11 11:50:57 +07:00
parent 077504f557
commit d642bf9098
10 changed files with 112 additions and 103 deletions

View File

@@ -494,7 +494,7 @@ func (s *baseServer) sendServerBusy(remoteAddr net.Addr, hdr *wire.Header) error
sealer, _ := handshake.NewInitialAEAD(hdr.DestConnectionID, protocol.PerspectiveServer)
packetBuffer := getPacketBuffer()
defer packetBuffer.Release()
buf := bytes.NewBuffer(packetBuffer.Slice[:0])
buf := bytes.NewBuffer(packetBuffer.Data)
ccf := &wire.ConnectionCloseFrame{ErrorCode: qerr.ServerBusy}