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(
|
auto partialReliability = getIntegerParameter(
|
||||||
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
||||||
serverParams.parameters);
|
serverParams.parameters);
|
||||||
|
auto activeConnectionIdLimit = getIntegerParameter(
|
||||||
|
TransportParameterId::active_connection_id_limit,
|
||||||
|
serverParams.parameters);
|
||||||
|
|
||||||
if (!packetSize || *packetSize == 0) {
|
if (!packetSize || *packetSize == 0) {
|
||||||
packetSize = kDefaultMaxUDPPayload;
|
packetSize = kDefaultMaxUDPPayload;
|
||||||
@@ -132,6 +135,9 @@ void processServerInitialParams(
|
|||||||
conn.udpSendPacketLen = *packetSize;
|
conn.udpSendPacketLen = *packetSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conn.peerActiveConnectionIdLimit =
|
||||||
|
activeConnectionIdLimit.value_or(kDefaultConnectionIdLimit);
|
||||||
|
|
||||||
if (partialReliability && *partialReliability != 0 &&
|
if (partialReliability && *partialReliability != 0 &&
|
||||||
conn.transportSettings.partialReliabilityEnabled) {
|
conn.transportSettings.partialReliabilityEnabled) {
|
||||||
conn.partialReliabilityEnabled = true;
|
conn.partialReliabilityEnabled = true;
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ constexpr size_t kMinInitialDestinationConnIdLength = 8;
|
|||||||
// set conn id version at the first 4 bits
|
// set conn id version at the first 4 bits
|
||||||
constexpr uint8_t kShortVersionId = 0x1;
|
constexpr uint8_t kShortVersionId = 0x1;
|
||||||
|
|
||||||
|
constexpr uint64_t kDefaultConnectionIdLimit = 0;
|
||||||
|
|
||||||
struct ConnectionId {
|
struct ConnectionId {
|
||||||
uint8_t* data();
|
uint8_t* data();
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ enum class TransportParameterId : uint16_t {
|
|||||||
max_ack_delay = 0x000b,
|
max_ack_delay = 0x000b,
|
||||||
disable_migration = 0x000c,
|
disable_migration = 0x000c,
|
||||||
preferred_address = 0x000d,
|
preferred_address = 0x000d,
|
||||||
|
active_connection_id_limit = 0x000e
|
||||||
};
|
};
|
||||||
|
|
||||||
struct TransportParameter {
|
struct TransportParameter {
|
||||||
|
|||||||
@@ -110,6 +110,10 @@ void processClientInitialParams(
|
|||||||
auto partialReliability = getIntegerParameter(
|
auto partialReliability = getIntegerParameter(
|
||||||
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
static_cast<TransportParameterId>(kPartialReliabilityParameterId),
|
||||||
clientParams.parameters);
|
clientParams.parameters);
|
||||||
|
auto activeConnectionIdLimit = getIntegerParameter(
|
||||||
|
TransportParameterId::active_connection_id_limit,
|
||||||
|
clientParams.parameters);
|
||||||
|
|
||||||
if (!packetSize || *packetSize == 0) {
|
if (!packetSize || *packetSize == 0) {
|
||||||
packetSize = kDefaultMaxUDPPayload;
|
packetSize = kDefaultMaxUDPPayload;
|
||||||
}
|
}
|
||||||
@@ -154,6 +158,9 @@ void processClientInitialParams(
|
|||||||
conn.udpSendPacketLen = *packetSize;
|
conn.udpSendPacketLen = *packetSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conn.peerActiveConnectionIdLimit =
|
||||||
|
activeConnectionIdLimit.value_or(kDefaultConnectionIdLimit);
|
||||||
|
|
||||||
if (partialReliability && *partialReliability != 0 &&
|
if (partialReliability && *partialReliability != 0 &&
|
||||||
conn.transportSettings.partialReliabilityEnabled) {
|
conn.transportSettings.partialReliabilityEnabled) {
|
||||||
conn.partialReliabilityEnabled = true;
|
conn.partialReliabilityEnabled = true;
|
||||||
|
|||||||
@@ -479,6 +479,8 @@ struct QuicConnectionStateBase {
|
|||||||
// Time at which the connection started.
|
// Time at which the connection started.
|
||||||
TimePoint connectionTime;
|
TimePoint connectionTime;
|
||||||
|
|
||||||
|
uint64_t peerActiveConnectionIdLimit{kDefaultConnectionIdLimit};
|
||||||
|
|
||||||
// The current connection id. This will eventually be negotiated
|
// The current connection id. This will eventually be negotiated
|
||||||
// with the peer.
|
// with the peer.
|
||||||
folly::Optional<ConnectionId> clientConnectionId;
|
folly::Optional<ConnectionId> clientConnectionId;
|
||||||
|
|||||||
Reference in New Issue
Block a user