mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
uTLS is not yet bumped to the new version, so this commit breaks the dependencies relationship by getting rid of the local replace.
32 lines
882 B
Go
32 lines
882 B
Go
package wire
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/refraction-networking/uquic/internal/protocol"
|
|
"github.com/refraction-networking/uquic/quicvarint"
|
|
)
|
|
|
|
// A RetireConnectionIDFrame is a RETIRE_CONNECTION_ID frame
|
|
type RetireConnectionIDFrame struct {
|
|
SequenceNumber uint64
|
|
}
|
|
|
|
func parseRetireConnectionIDFrame(r *bytes.Reader, _ protocol.VersionNumber) (*RetireConnectionIDFrame, error) {
|
|
seq, err := quicvarint.Read(r)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &RetireConnectionIDFrame{SequenceNumber: seq}, nil
|
|
}
|
|
|
|
func (f *RetireConnectionIDFrame) Append(b []byte, _ protocol.VersionNumber) ([]byte, error) {
|
|
b = append(b, retireConnectionIDFrameType)
|
|
b = quicvarint.Append(b, f.SequenceNumber)
|
|
return b, nil
|
|
}
|
|
|
|
// Length of a written frame
|
|
func (f *RetireConnectionIDFrame) Length(protocol.VersionNumber) protocol.ByteCount {
|
|
return 1 + quicvarint.Len(f.SequenceNumber)
|
|
}
|