forked from quic-go/quic-go
send the max_datagram_frame_size transport parameter
This commit is contained in:
@@ -125,6 +125,11 @@ const MaxPostHandshakeCryptoFrameSize = 1000
|
|||||||
// but must ensure that a maximum size ACK frame fits into one packet.
|
// but must ensure that a maximum size ACK frame fits into one packet.
|
||||||
const MaxAckFrameSize ByteCount = 1000
|
const MaxAckFrameSize ByteCount = 1000
|
||||||
|
|
||||||
|
// MaxDatagramFrameSize is the maximum size of a DATAGRAM frame as defined in
|
||||||
|
// https://datatracker.ietf.org/doc/draft-pauly-quic-datagram/.
|
||||||
|
// The size is chosen such that a DATAGRAM frame fits into a QUIC packet.
|
||||||
|
const MaxDatagramFrameSize ByteCount = 1200
|
||||||
|
|
||||||
// MaxNumAckRanges is the maximum number of ACK ranges that we send in an ACK frame.
|
// MaxNumAckRanges is the maximum number of ACK ranges that we send in an ACK frame.
|
||||||
// It also serves as a limit for the packet history.
|
// It also serves as a limit for the packet history.
|
||||||
// If at any point we keep track of more ranges, old ranges are discarded.
|
// If at any point we keep track of more ranges, old ranges are discarded.
|
||||||
|
|||||||
@@ -296,7 +296,9 @@ var newSession = func(
|
|||||||
ActiveConnectionIDLimit: protocol.MaxActiveConnectionIDs,
|
ActiveConnectionIDLimit: protocol.MaxActiveConnectionIDs,
|
||||||
InitialSourceConnectionID: srcConnID,
|
InitialSourceConnectionID: srcConnID,
|
||||||
RetrySourceConnectionID: retrySrcConnID,
|
RetrySourceConnectionID: retrySrcConnID,
|
||||||
MaxDatagramFrameSize: protocol.InvalidByteCount, // disable DATAGRAMs
|
}
|
||||||
|
if s.config.EnableDatagrams {
|
||||||
|
params.MaxDatagramFrameSize = protocol.MaxDatagramFrameSize
|
||||||
}
|
}
|
||||||
if s.tracer != nil {
|
if s.tracer != nil {
|
||||||
s.tracer.SentTransportParameters(params)
|
s.tracer.SentTransportParameters(params)
|
||||||
@@ -417,7 +419,9 @@ var newClientSession = func(
|
|||||||
DisableActiveMigration: true,
|
DisableActiveMigration: true,
|
||||||
ActiveConnectionIDLimit: protocol.MaxActiveConnectionIDs,
|
ActiveConnectionIDLimit: protocol.MaxActiveConnectionIDs,
|
||||||
InitialSourceConnectionID: srcConnID,
|
InitialSourceConnectionID: srcConnID,
|
||||||
MaxDatagramFrameSize: protocol.InvalidByteCount, // disable DATAGRAMs
|
}
|
||||||
|
if s.config.EnableDatagrams {
|
||||||
|
params.MaxDatagramFrameSize = protocol.MaxDatagramFrameSize
|
||||||
}
|
}
|
||||||
if s.tracer != nil {
|
if s.tracer != nil {
|
||||||
s.tracer.SentTransportParameters(params)
|
s.tracer.SentTransportParameters(params)
|
||||||
|
|||||||
Reference in New Issue
Block a user