forked from quic-go/quic-go
improve memory alignment of frequently used structs
This commit is contained in:
@@ -46,13 +46,14 @@ type TransportParameters struct {
|
|||||||
MaxAckDelay time.Duration
|
MaxAckDelay time.Duration
|
||||||
AckDelayExponent uint8
|
AckDelayExponent uint8
|
||||||
|
|
||||||
|
DisableMigration bool
|
||||||
|
|
||||||
MaxPacketSize protocol.ByteCount
|
MaxPacketSize protocol.ByteCount
|
||||||
|
|
||||||
MaxUniStreamNum protocol.StreamNum
|
MaxUniStreamNum protocol.StreamNum
|
||||||
MaxBidiStreamNum protocol.StreamNum
|
MaxBidiStreamNum protocol.StreamNum
|
||||||
|
|
||||||
IdleTimeout time.Duration
|
IdleTimeout time.Duration
|
||||||
DisableMigration bool
|
|
||||||
|
|
||||||
StatelessResetToken *[16]byte
|
StatelessResetToken *[16]byte
|
||||||
OriginalConnectionID protocol.ConnectionID
|
OriginalConnectionID protocol.ConnectionID
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ type ExtendedHeader struct {
|
|||||||
|
|
||||||
typeByte byte
|
typeByte byte
|
||||||
|
|
||||||
|
KeyPhase protocol.KeyPhaseBit
|
||||||
|
|
||||||
PacketNumberLen protocol.PacketNumberLen
|
PacketNumberLen protocol.PacketNumberLen
|
||||||
PacketNumber protocol.PacketNumber
|
PacketNumber protocol.PacketNumber
|
||||||
|
|
||||||
KeyPhase protocol.KeyPhaseBit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *ExtendedHeader) parse(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) {
|
func (h *ExtendedHeader) parse(b *bytes.Reader, v protocol.VersionNumber) (*ExtendedHeader, error) {
|
||||||
|
|||||||
@@ -46,19 +46,20 @@ var errUnsupportedVersion = errors.New("unsupported version")
|
|||||||
|
|
||||||
// The Header is the version independent part of the header
|
// The Header is the version independent part of the header
|
||||||
type Header struct {
|
type Header struct {
|
||||||
|
IsLongHeader bool
|
||||||
|
typeByte byte
|
||||||
|
Type protocol.PacketType
|
||||||
|
|
||||||
Version protocol.VersionNumber
|
Version protocol.VersionNumber
|
||||||
SrcConnectionID protocol.ConnectionID
|
SrcConnectionID protocol.ConnectionID
|
||||||
DestConnectionID protocol.ConnectionID
|
DestConnectionID protocol.ConnectionID
|
||||||
|
|
||||||
IsLongHeader bool
|
Length protocol.ByteCount
|
||||||
Type protocol.PacketType
|
|
||||||
Length protocol.ByteCount
|
|
||||||
|
|
||||||
Token []byte
|
Token []byte
|
||||||
SupportedVersions []protocol.VersionNumber // sent in a Version Negotiation Packet
|
SupportedVersions []protocol.VersionNumber // sent in a Version Negotiation Packet
|
||||||
OrigDestConnectionID protocol.ConnectionID // sent in the Retry packet
|
OrigDestConnectionID protocol.ConnectionID // sent in the Retry packet
|
||||||
|
|
||||||
typeByte byte
|
|
||||||
parsedLen protocol.ByteCount // how many bytes were read while parsing this header
|
parsedLen protocol.ByteCount // how many bytes were read while parsing this header
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import (
|
|||||||
// A StreamFrame of QUIC
|
// A StreamFrame of QUIC
|
||||||
type StreamFrame struct {
|
type StreamFrame struct {
|
||||||
StreamID protocol.StreamID
|
StreamID protocol.StreamID
|
||||||
FinBit bool
|
|
||||||
DataLenPresent bool
|
|
||||||
Offset protocol.ByteCount
|
Offset protocol.ByteCount
|
||||||
Data []byte
|
Data []byte
|
||||||
|
FinBit bool
|
||||||
|
DataLenPresent bool
|
||||||
|
|
||||||
fromPool bool
|
fromPool bool
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user