only trace dropped 0-RTT packets when a tracer is set

This commit is contained in:
Marten Seemann 2020-11-11 17:13:56 +07:00
parent d0cdfc8926
commit 0d5de40d45

View file

@ -809,7 +809,9 @@ func (s *session) handleSinglePacket(p *receivedPacket, hdr *wire.Header) bool /
}
// drop 0-RTT packets, if we are a client
if s.perspective == protocol.PerspectiveClient && hdr.Type == protocol.PacketType0RTT {
s.tracer.DroppedPacket(logging.PacketType0RTT, p.Size(), logging.PacketDropKeyUnavailable)
if s.tracer != nil {
s.tracer.DroppedPacket(logging.PacketType0RTT, p.Size(), logging.PacketDropKeyUnavailable)
}
return false
}