forked from quic-go/quic-go
logging / qlog: add support for DPLPMTUD (#4517)
* logging / qlog: add support for DPLPMTUD * improve the MTU discovery integration test
This commit is contained in:
@@ -24,6 +24,7 @@ type ConnectionTracer struct {
|
||||
UpdatedMetrics func(rttStats *RTTStats, cwnd, bytesInFlight ByteCount, packetsInFlight int)
|
||||
AcknowledgedPacket func(EncryptionLevel, PacketNumber)
|
||||
LostPacket func(EncryptionLevel, PacketNumber, PacketLossReason)
|
||||
UpdatedMTU func(mtu ByteCount, done bool)
|
||||
UpdatedCongestionState func(CongestionState)
|
||||
UpdatedPTOCount func(value uint32)
|
||||
UpdatedKeyFromTLS func(EncryptionLevel, Perspective)
|
||||
@@ -168,6 +169,13 @@ func NewMultiplexedConnectionTracer(tracers ...*ConnectionTracer) *ConnectionTra
|
||||
}
|
||||
}
|
||||
},
|
||||
UpdatedMTU: func(mtu ByteCount, done bool) {
|
||||
for _, t := range tracers {
|
||||
if t.UpdatedMTU != nil {
|
||||
t.UpdatedMTU(mtu, done)
|
||||
}
|
||||
}
|
||||
},
|
||||
UpdatedCongestionState: func(state CongestionState) {
|
||||
for _, t := range tracers {
|
||||
if t.UpdatedCongestionState != nil {
|
||||
|
||||
@@ -201,6 +201,12 @@ var _ = Describe("Tracing", func() {
|
||||
tracer.DroppedPacket(PacketTypeInitial, 42, 1337, PacketDropHeaderParseError)
|
||||
})
|
||||
|
||||
It("traces the UpdatedMTU event", func() {
|
||||
tr1.EXPECT().UpdatedMTU(ByteCount(1337), true)
|
||||
tr2.EXPECT().UpdatedMTU(ByteCount(1337), true)
|
||||
tracer.UpdatedMTU(1337, true)
|
||||
})
|
||||
|
||||
It("traces the UpdatedCongestionState event", func() {
|
||||
tr1.EXPECT().UpdatedCongestionState(CongestionStateRecovery)
|
||||
tr2.EXPECT().UpdatedCongestionState(CongestionStateRecovery)
|
||||
|
||||
Reference in New Issue
Block a user