mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-05 13:17:36 +03:00
read the ECN bits
This commit is contained in:
parent
876ab1d531
commit
ea3d32394d
19 changed files with 420 additions and 75 deletions
|
@ -756,6 +756,7 @@ var _ = Describe("Session", func() {
|
|||
PacketNumberLen: protocol.PacketNumberLen1,
|
||||
}
|
||||
packet := getPacket(hdr, nil)
|
||||
packet.ecn = protocol.ECNCE
|
||||
rcvTime := time.Now().Add(-10 * time.Second)
|
||||
unpacker.EXPECT().Unpack(gomock.Any(), rcvTime, gomock.Any()).Return(&unpackedPacket{
|
||||
packetNumber: 0x1337,
|
||||
|
@ -766,7 +767,7 @@ var _ = Describe("Session", func() {
|
|||
rph := mockackhandler.NewMockReceivedPacketHandler(mockCtrl)
|
||||
gomock.InOrder(
|
||||
rph.EXPECT().IsPotentiallyDuplicate(protocol.PacketNumber(0x1337), protocol.EncryptionInitial),
|
||||
rph.EXPECT().ReceivedPacket(protocol.PacketNumber(0x1337), protocol.ECNNon, protocol.EncryptionInitial, rcvTime, false),
|
||||
rph.EXPECT().ReceivedPacket(protocol.PacketNumber(0x1337), protocol.ECNCE, protocol.EncryptionInitial, rcvTime, false),
|
||||
)
|
||||
sess.receivedPacketHandler = rph
|
||||
packet.rcvTime = rcvTime
|
||||
|
@ -785,6 +786,7 @@ var _ = Describe("Session", func() {
|
|||
buf := &bytes.Buffer{}
|
||||
Expect((&wire.PingFrame{}).Write(buf, sess.version)).To(Succeed())
|
||||
packet := getPacket(hdr, nil)
|
||||
packet.ecn = protocol.ECT1
|
||||
unpacker.EXPECT().Unpack(gomock.Any(), rcvTime, gomock.Any()).Return(&unpackedPacket{
|
||||
packetNumber: 0x1337,
|
||||
encryptionLevel: protocol.Encryption1RTT,
|
||||
|
@ -794,7 +796,7 @@ var _ = Describe("Session", func() {
|
|||
rph := mockackhandler.NewMockReceivedPacketHandler(mockCtrl)
|
||||
gomock.InOrder(
|
||||
rph.EXPECT().IsPotentiallyDuplicate(protocol.PacketNumber(0x1337), protocol.Encryption1RTT),
|
||||
rph.EXPECT().ReceivedPacket(protocol.PacketNumber(0x1337), protocol.ECNNon, protocol.Encryption1RTT, rcvTime, true),
|
||||
rph.EXPECT().ReceivedPacket(protocol.PacketNumber(0x1337), protocol.ECT1, protocol.Encryption1RTT, rcvTime, true),
|
||||
)
|
||||
sess.receivedPacketHandler = rph
|
||||
packet.rcvTime = rcvTime
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue