protocol: use the packet number decoding / encoding logic from the RFC (#4661)

This commit is contained in:
Marten Seemann 2024-09-06 00:54:44 +08:00 committed by GitHub
parent 135b8c0e75
commit 4be70e0146
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 234 deletions

View file

@ -756,7 +756,7 @@ func (h *sentPacketHandler) PeekPacketNumber(encLevel protocol.EncryptionLevel)
pnSpace := h.getPacketNumberSpace(encLevel)
pn := pnSpace.pns.Peek()
// See section 17.1 of RFC 9000.
return pn, protocol.GetPacketNumberLengthForHeader(pn, pnSpace.largestAcked)
return pn, protocol.PacketNumberLengthForHeader(pn, pnSpace.largestAcked)
}
func (h *sentPacketHandler) PopPacketNumber(encLevel protocol.EncryptionLevel) protocol.PacketNumber {