mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
wire: save ECN counts on the ACK frame (#3829)
This commit is contained in:
parent
02013caaa4
commit
378e3c8b74
2 changed files with 17 additions and 5 deletions
|
@ -90,13 +90,22 @@ func parseAckFrame(r *bytes.Reader, typ uint64, ackDelayExponent uint8, _ protoc
|
||||||
return nil, errInvalidAckRanges
|
return nil, errInvalidAckRanges
|
||||||
}
|
}
|
||||||
|
|
||||||
// parse (and skip) the ECN section
|
|
||||||
if ecn {
|
if ecn {
|
||||||
for i := 0; i < 3; i++ {
|
ect0, err := quicvarint.Read(r)
|
||||||
if _, err := quicvarint.Read(r); err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
frame.ECT0 = ect0
|
||||||
|
ect1, err := quicvarint.Read(r)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
frame.ECT1 = ect1
|
||||||
|
ecnce, err := quicvarint.Read(r)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
frame.ECNCE = ecnce
|
||||||
}
|
}
|
||||||
|
|
||||||
return frame, nil
|
return frame, nil
|
||||||
|
|
|
@ -170,6 +170,9 @@ var _ = Describe("ACK Frame (for IETF QUIC)", func() {
|
||||||
Expect(frame.LargestAcked()).To(Equal(protocol.PacketNumber(100)))
|
Expect(frame.LargestAcked()).To(Equal(protocol.PacketNumber(100)))
|
||||||
Expect(frame.LowestAcked()).To(Equal(protocol.PacketNumber(90)))
|
Expect(frame.LowestAcked()).To(Equal(protocol.PacketNumber(90)))
|
||||||
Expect(frame.HasMissingRanges()).To(BeFalse())
|
Expect(frame.HasMissingRanges()).To(BeFalse())
|
||||||
|
Expect(frame.ECT0).To(BeEquivalentTo(0x42))
|
||||||
|
Expect(frame.ECT1).To(BeEquivalentTo(0x12345))
|
||||||
|
Expect(frame.ECNCE).To(BeEquivalentTo(0x12345678))
|
||||||
Expect(b.Len()).To(BeZero())
|
Expect(b.Len()).To(BeZero())
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue