mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 04:37:36 +03:00
make the logging.Tracer and logging.ConnectionTracer a struct (#4082)
This commit is contained in:
parent
d8cc4cb3ef
commit
9b82196578
46 changed files with 1388 additions and 1158 deletions
|
@ -69,7 +69,7 @@ type Transport struct {
|
|||
DisableVersionNegotiationPackets bool
|
||||
|
||||
// A Tracer traces events that don't belong to a single QUIC connection.
|
||||
Tracer logging.Tracer
|
||||
Tracer *logging.Tracer
|
||||
|
||||
handlerMap packetHandlerManager
|
||||
|
||||
|
@ -363,7 +363,7 @@ func (t *Transport) handlePacket(p receivedPacket) {
|
|||
connID, err := wire.ParseConnectionID(p.data, t.connIDLen)
|
||||
if err != nil {
|
||||
t.logger.Debugf("error parsing connection ID on packet from %s: %s", p.remoteAddr, err)
|
||||
if t.Tracer != nil {
|
||||
if t.Tracer != nil && t.Tracer.DroppedPacket != nil {
|
||||
t.Tracer.DroppedPacket(p.remoteAddr, logging.PacketTypeNotDetermined, p.Size(), logging.PacketDropHeaderParseError)
|
||||
}
|
||||
p.buffer.MaybeRelease()
|
||||
|
@ -458,7 +458,7 @@ func (t *Transport) handleNonQUICPacket(p receivedPacket) {
|
|||
select {
|
||||
case t.nonQUICPackets <- p:
|
||||
default:
|
||||
if t.Tracer != nil {
|
||||
if t.Tracer != nil && t.Tracer.DroppedPacket != nil {
|
||||
t.Tracer.DroppedPacket(p.remoteAddr, logging.PacketTypeNotDetermined, p.Size(), logging.PacketDropDOSPrevention)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue