mirror of
https://github.com/facebookincubator/mvfst.git
synced 2025-11-09 10:00:57 +03:00
active_connection_id_limit transport parameter
Summary: ^ This parameter was added in d-21. Default value is 0 meaning no provided connection id apart from the initial ones. This limits the amount of connection ids the peer provides via `NEW_CONNECTION_ID` frame. Diff to set this value will be added in later, along with `NEW_CONNECTION_ID`. Reviewed By: JunqiWang Differential Revision: D17532007 fbshipit-source-id: 5b86f69a8d3372fbcb7e0882508ea2661a9d4864
This commit is contained in:
committed by
Facebook Github Bot
parent
ba2ec5b252
commit
d7748a8382
@@ -85,6 +85,9 @@ void processServerInitialParams(
|
||||
auto partialReliability = getIntegerParameter(
|
||||
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
||||
serverParams.parameters);
|
||||
auto activeConnectionIdLimit = getIntegerParameter(
|
||||
TransportParameterId::active_connection_id_limit,
|
||||
serverParams.parameters);
|
||||
|
||||
if (!packetSize || *packetSize == 0) {
|
||||
packetSize = kDefaultMaxUDPPayload;
|
||||
@@ -132,6 +135,9 @@ void processServerInitialParams(
|
||||
conn.udpSendPacketLen = *packetSize;
|
||||
}
|
||||
|
||||
conn.peerActiveConnectionIdLimit =
|
||||
activeConnectionIdLimit.value_or(kDefaultConnectionIdLimit);
|
||||
|
||||
if (partialReliability && *partialReliability != 0 &&
|
||||
conn.transportSettings.partialReliabilityEnabled) {
|
||||
conn.partialReliabilityEnabled = true;
|
||||
|
||||
@@ -28,6 +28,8 @@ constexpr size_t kMinInitialDestinationConnIdLength = 8;
|
||||
// set conn id version at the first 4 bits
|
||||
constexpr uint8_t kShortVersionId = 0x1;
|
||||
|
||||
constexpr uint64_t kDefaultConnectionIdLimit = 0;
|
||||
|
||||
struct ConnectionId {
|
||||
uint8_t* data();
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ enum class TransportParameterId : uint16_t {
|
||||
max_ack_delay = 0x000b,
|
||||
disable_migration = 0x000c,
|
||||
preferred_address = 0x000d,
|
||||
active_connection_id_limit = 0x000e
|
||||
};
|
||||
|
||||
struct TransportParameter {
|
||||
|
||||
@@ -110,6 +110,10 @@ void processClientInitialParams(
|
||||
auto partialReliability = getIntegerParameter(
|
||||
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
||||
clientParams.parameters);
|
||||
auto activeConnectionIdLimit = getIntegerParameter(
|
||||
TransportParameterId::active_connection_id_limit,
|
||||
clientParams.parameters);
|
||||
|
||||
if (!packetSize || *packetSize == 0) {
|
||||
packetSize = kDefaultMaxUDPPayload;
|
||||
}
|
||||
@@ -154,6 +158,9 @@ void processClientInitialParams(
|
||||
conn.udpSendPacketLen = *packetSize;
|
||||
}
|
||||
|
||||
conn.peerActiveConnectionIdLimit =
|
||||
activeConnectionIdLimit.value_or(kDefaultConnectionIdLimit);
|
||||
|
||||
if (partialReliability && *partialReliability != 0 &&
|
||||
conn.transportSettings.partialReliabilityEnabled) {
|
||||
conn.partialReliabilityEnabled = true;
|
||||
|
||||
@@ -479,6 +479,8 @@ struct QuicConnectionStateBase {
|
||||
// Time at which the connection started.
|
||||
TimePoint connectionTime;
|
||||
|
||||
uint64_t peerActiveConnectionIdLimit{kDefaultConnectionIdLimit};
|
||||
|
||||
// The current connection id. This will eventually be negotiated
|
||||
// with the peer.
|
||||
folly::Optional<ConnectionId> clientConnectionId;
|
||||
|
||||
Reference in New Issue
Block a user