split the tracing function for received short and long header packets

This commit is contained in:
Marten Seemann 2022-08-27 15:46:37 +03:00
parent 3a12a898a5
commit ed15a94703
18 changed files with 222 additions and 89 deletions

View file

@ -84,11 +84,8 @@ var _ = Describe("Packetization", func() {
}
Expect(conn.CloseWithError(0, "")).To(Succeed())
countBundledPackets := func(packets []packet) (numBundled int) {
countBundledPackets := func(packets []shortHeaderPacket) (numBundled int) {
for _, p := range packets {
if p.hdr.IsLongHeader {
continue
}
var hasAck, hasStreamFrame bool
for _, f := range p.frames {
switch f.(type) {
@ -105,8 +102,8 @@ var _ = Describe("Packetization", func() {
return
}
numBundledIncoming := countBundledPackets(clientTracer.getRcvdPackets())
numBundledOutgoing := countBundledPackets(serverTracer.getRcvdPackets())
numBundledIncoming := countBundledPackets(clientTracer.getRcvdShortHeaderPackets())
numBundledOutgoing := countBundledPackets(serverTracer.getRcvdShortHeaderPackets())
fmt.Fprintf(GinkgoWriter, "bundled incoming packets: %d / %d\n", numBundledIncoming, numMsg)
fmt.Fprintf(GinkgoWriter, "bundled outgoing packets: %d / %d\n", numBundledOutgoing, numMsg)
Expect(numBundledIncoming).To(And(