forked from quic-go/quic-go
also count coalesced 0-RTT packets in the integration tests
This commit is contained in:
@@ -35,10 +35,14 @@ var _ = Describe("0-RTT", func() {
|
|||||||
proxy, err := quicproxy.NewQuicProxy("localhost:0", &quicproxy.Opts{
|
proxy, err := quicproxy.NewQuicProxy("localhost:0", &quicproxy.Opts{
|
||||||
RemoteAddr: fmt.Sprintf("localhost:%d", serverPort),
|
RemoteAddr: fmt.Sprintf("localhost:%d", serverPort),
|
||||||
DelayPacket: func(_ quicproxy.Direction, data []byte) time.Duration {
|
DelayPacket: func(_ quicproxy.Direction, data []byte) time.Duration {
|
||||||
hdr, _, _, err := wire.ParsePacket(data, 0)
|
for len(data) > 0 {
|
||||||
Expect(err).ToNot(HaveOccurred())
|
hdr, _, rest, err := wire.ParsePacket(data, 0)
|
||||||
if hdr.Type == protocol.PacketType0RTT {
|
Expect(err).ToNot(HaveOccurred())
|
||||||
atomic.AddUint32(&num0RTTPackets, 1)
|
if hdr.Type == protocol.PacketType0RTT {
|
||||||
|
atomic.AddUint32(&num0RTTPackets, 1)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
data = rest
|
||||||
}
|
}
|
||||||
return rtt / 2
|
return rtt / 2
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user