mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-06 05:37:36 +03:00
remove version dependency of packet number inferring
This commit is contained in:
parent
4145bcc8a7
commit
faed2ba30a
5 changed files with 38 additions and 43 deletions
|
@ -5,7 +5,6 @@ func InferPacketNumber(
|
|||
packetNumberLength PacketNumberLen,
|
||||
lastPacketNumber PacketNumber,
|
||||
wirePacketNumber PacketNumber,
|
||||
version VersionNumber,
|
||||
) PacketNumber {
|
||||
var epochDelta PacketNumber
|
||||
switch packetNumberLength {
|
||||
|
@ -42,7 +41,7 @@ func delta(a, b PacketNumber) PacketNumber {
|
|||
|
||||
// GetPacketNumberLengthForHeader gets the length of the packet number for the public header
|
||||
// it never chooses a PacketNumberLen of 1 byte, since this is too short under certain circumstances
|
||||
func GetPacketNumberLengthForHeader(packetNumber, leastUnacked PacketNumber, version VersionNumber) PacketNumberLen {
|
||||
func GetPacketNumberLengthForHeader(packetNumber, leastUnacked PacketNumber) PacketNumberLen {
|
||||
diff := uint64(packetNumber - leastUnacked)
|
||||
if diff < (1 << (14 - 1)) {
|
||||
return PacketNumberLen2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue