new: uquic

This commit is contained in:
Gaukas Wang 2023-08-02 15:38:16 -06:00
parent 95f3eaaa66
commit ea40752ca3
No known key found for this signature in database
GPG key ID: 9E2F8986D76F8B5D
25 changed files with 1420 additions and 686 deletions

View file

@ -96,8 +96,6 @@ type sentPacketHandler struct {
tracer logging.ConnectionTracer
logger utils.Logger
initialPacketNumberLength protocol.PacketNumberLen // [UQUIC]
}
var (
@ -138,12 +136,6 @@ func newSentPacketHandler(
}
}
func SetInitialPacketNumberLength(h SentPacketHandler, pnLen protocol.PacketNumberLen) {
if sph, ok := h.(*sentPacketHandler); ok {
sph.initialPacketNumberLength = pnLen
}
}
func (h *sentPacketHandler) removeFromBytesInFlight(p *packet) {
if p.includedInBytesInFlight {
if p.Length > h.bytesInFlight {
@ -725,11 +717,6 @@ func (h *sentPacketHandler) PeekPacketNumber(encLevel protocol.EncryptionLevel)
pn := pnSpace.pns.Peek()
// See section 17.1 of RFC 9000.
// [UQUIC] This kinda breaks PN length mimicry.
if encLevel == protocol.EncryptionInitial && h.initialPacketNumberLength != 0 {
return pn, h.initialPacketNumberLength
}
return pn, protocol.GetPacketNumberLengthForHeader(pn, pnSpace.largestAcked)
}