From 19cebde7c73d5606c27428ef725e17eb1caee969 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 5 Aug 2021 12:54:43 +0200 Subject: [PATCH] also count coalesced 0-RTT packets in the integration tests --- integrationtests/self/zero_rtt_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/integrationtests/self/zero_rtt_test.go b/integrationtests/self/zero_rtt_test.go index ee963b5d2..4b05dee44 100644 --- a/integrationtests/self/zero_rtt_test.go +++ b/integrationtests/self/zero_rtt_test.go @@ -35,10 +35,14 @@ var _ = Describe("0-RTT", func() { proxy, err := quicproxy.NewQuicProxy("localhost:0", &quicproxy.Opts{ RemoteAddr: fmt.Sprintf("localhost:%d", serverPort), DelayPacket: func(_ quicproxy.Direction, data []byte) time.Duration { - hdr, _, _, err := wire.ParsePacket(data, 0) - Expect(err).ToNot(HaveOccurred()) - if hdr.Type == protocol.PacketType0RTT { - atomic.AddUint32(&num0RTTPackets, 1) + for len(data) > 0 { + hdr, _, rest, err := wire.ParsePacket(data, 0) + Expect(err).ToNot(HaveOccurred()) + if hdr.Type == protocol.PacketType0RTT { + atomic.AddUint32(&num0RTTPackets, 1) + break + } + data = rest } return rtt / 2 },