forked from quic-go/quic-go
don't preallocate a slice for undecryptable packets
Under normal conditions, we don't expect to receive any undecryptable packets. We expect to receive a few when there's packet loss and / or reordering during the handshake, but even in that case the number will most likely be smaller than protocol.MaxUndecryptablePackets.
This commit is contained in:
@@ -493,7 +493,6 @@ func (s *session) preSetup() {
|
||||
s.receivedPackets = make(chan *receivedPacket, protocol.MaxSessionUnprocessedPackets)
|
||||
s.closeChan = make(chan closeError, 1)
|
||||
s.sendingScheduled = make(chan struct{}, 1)
|
||||
s.undecryptablePackets = make([]*receivedPacket, 0, protocol.MaxUndecryptablePackets)
|
||||
s.ctx, s.ctxCancel = context.WithCancel(context.Background())
|
||||
s.handshakeCtx, s.handshakeCtxCancel = context.WithCancel(context.Background())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user