mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 21:27:35 +03:00
don't pass the header to connection.tryQueueingUndecryptablePacket
This commit is contained in:
parent
f41772c43c
commit
7d827d515e
1 changed files with 6 additions and 4 deletions
|
@ -952,7 +952,7 @@ func (s *connection) handleSinglePacket(p *receivedPacket, hdr *wire.Header) boo
|
||||||
// Sealer for this encryption level not yet available.
|
// Sealer for this encryption level not yet available.
|
||||||
// Try again later.
|
// Try again later.
|
||||||
wasQueued = true
|
wasQueued = true
|
||||||
s.tryQueueingUndecryptablePacket(p, hdr)
|
s.tryQueueingUndecryptablePacket(p, logging.PacketTypeFromHeader(hdr))
|
||||||
case wire.ErrInvalidReservedBits:
|
case wire.ErrInvalidReservedBits:
|
||||||
s.closeLocal(&qerr.TransportError{
|
s.closeLocal(&qerr.TransportError{
|
||||||
ErrorCode: qerr.ProtocolViolation,
|
ErrorCode: qerr.ProtocolViolation,
|
||||||
|
@ -1936,20 +1936,22 @@ func (s *connection) scheduleSending() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *connection) tryQueueingUndecryptablePacket(p *receivedPacket, hdr *wire.Header) {
|
// tryQueueingUndecryptablePacket queues a packet for which we're missing the decryption keys.
|
||||||
|
// The logging.PacketType is only used for logging purposes.
|
||||||
|
func (s *connection) tryQueueingUndecryptablePacket(p *receivedPacket, pt logging.PacketType) {
|
||||||
if s.handshakeComplete {
|
if s.handshakeComplete {
|
||||||
panic("shouldn't queue undecryptable packets after handshake completion")
|
panic("shouldn't queue undecryptable packets after handshake completion")
|
||||||
}
|
}
|
||||||
if len(s.undecryptablePackets)+1 > protocol.MaxUndecryptablePackets {
|
if len(s.undecryptablePackets)+1 > protocol.MaxUndecryptablePackets {
|
||||||
if s.tracer != nil {
|
if s.tracer != nil {
|
||||||
s.tracer.DroppedPacket(logging.PacketTypeFromHeader(hdr), p.Size(), logging.PacketDropDOSPrevention)
|
s.tracer.DroppedPacket(pt, p.Size(), logging.PacketDropDOSPrevention)
|
||||||
}
|
}
|
||||||
s.logger.Infof("Dropping undecryptable packet (%d bytes). Undecryptable packet queue full.", p.Size())
|
s.logger.Infof("Dropping undecryptable packet (%d bytes). Undecryptable packet queue full.", p.Size())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
s.logger.Infof("Queueing packet (%d bytes) for later decryption", p.Size())
|
s.logger.Infof("Queueing packet (%d bytes) for later decryption", p.Size())
|
||||||
if s.tracer != nil {
|
if s.tracer != nil {
|
||||||
s.tracer.BufferedPacket(logging.PacketTypeFromHeader(hdr))
|
s.tracer.BufferedPacket(pt)
|
||||||
}
|
}
|
||||||
s.undecryptablePackets = append(s.undecryptablePackets, p)
|
s.undecryptablePackets = append(s.undecryptablePackets, p)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue