introduce separate tracing calls for sent long and short header packets

This commit is contained in:
Marten Seemann 2022-08-30 15:59:55 +03:00
parent 9e5f92b561
commit 24be84cd00
14 changed files with 127 additions and 61 deletions

View file

@ -157,13 +157,22 @@ var _ = Describe("Tracing", func() {
tracer.RestoredTransportParameters(tp)
})
It("traces the SentPacket event", func() {
It("traces the SentLongHeaderPacket event", func() {
hdr := &ExtendedHeader{Header: Header{DestConnectionID: protocol.ParseConnectionID([]byte{1, 2, 3})}}
ack := &AckFrame{AckRanges: []AckRange{{Smallest: 1, Largest: 10}}}
ping := &PingFrame{}
tr1.EXPECT().SentPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tr2.EXPECT().SentPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tracer.SentPacket(hdr, 1337, ack, []Frame{ping})
tr1.EXPECT().SentLongHeaderPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tr2.EXPECT().SentLongHeaderPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tracer.SentLongHeaderPacket(hdr, 1337, ack, []Frame{ping})
})
It("traces the SentShortHeaderPacket event", func() {
hdr := &ShortHeader{DestConnectionID: protocol.ParseConnectionID([]byte{1, 2, 3})}
ack := &AckFrame{AckRanges: []AckRange{{Smallest: 1, Largest: 10}}}
ping := &PingFrame{}
tr1.EXPECT().SentShortHeaderPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tr2.EXPECT().SentShortHeaderPacket(hdr, ByteCount(1337), ack, []Frame{ping})
tracer.SentShortHeaderPacket(hdr, 1337, ack, []Frame{ping})
})
It("traces the ReceivedVersionNegotiationPacket event", func() {