1
0
mirror of https://github.com/facebookincubator/mvfst.git synced 2025-11-09 10:00:57 +03:00

MaxNumMigrationsAllowed Transport Setting

Summary: - add configurable `maxNumMigrationsAllowed` to transport settings

Reviewed By: kvtsoy

Differential Revision: D41137450

fbshipit-source-id: a82c97e0b58c13f5df3c4cd075d3f17702eca009
This commit is contained in:
Hani Damlaj
2022-11-10 16:55:07 -08:00
committed by Facebook GitHub Bot
parent 772b47adaa
commit 729623ca26
4 changed files with 8 additions and 3 deletions

View File

@@ -581,7 +581,7 @@ constexpr std::chrono::seconds kTimeToRetainZeroRttKeys = 20s;
constexpr std::chrono::seconds kTimeToRetainLastCongestionAndRttState = 60s; constexpr std::chrono::seconds kTimeToRetainLastCongestionAndRttState = 60s;
constexpr uint32_t kMaxNumMigrationsAllowed = 6; constexpr uint16_t kMaxNumMigrationsAllowed = 6;
constexpr auto kExpectedNumOfParamsInTheTicket = 8; constexpr auto kExpectedNumOfParamsInTheTicket = 8;

View File

@@ -594,7 +594,8 @@ void onConnectionMigration(
QuicServerConnectionState& conn, QuicServerConnectionState& conn,
const folly::SocketAddress& newPeerAddress, const folly::SocketAddress& newPeerAddress,
bool isIntentional) { bool isIntentional) {
if (conn.migrationState.numMigrations >= kMaxNumMigrationsAllowed) { if (conn.migrationState.numMigrations >=
conn.transportSettings.maxNumMigrationsAllowed) {
if (conn.qLogger) { if (conn.qLogger) {
conn.qLogger->addPacketDrop( conn.qLogger->addPacketDrop(
0, 0,

View File

@@ -2209,7 +2209,9 @@ TEST_F(QuicServerTransportTest, TooManyMigrations) {
0 /* cipherOverhead */, 0 /* cipherOverhead */,
0 /* largestAcked */)); 0 /* largestAcked */));
for (size_t i = 0; i < kMaxNumMigrationsAllowed; ++i) { uint16_t maxNumMigrationsAllowed =
server->getConn().transportSettings.maxNumMigrationsAllowed;
for (uint16_t i = 0; i < maxNumMigrationsAllowed; ++i) {
folly::SocketAddress newPeer("100.101.102.103", 23456 + i); folly::SocketAddress newPeer("100.101.102.103", 23456 + i);
deliverData(packetData->clone(), false, &newPeer); deliverData(packetData->clone(), false, &newPeer);
} }

View File

@@ -177,6 +177,8 @@ struct TransportSettings {
bool connectUDP{false}; bool connectUDP{false};
// Maximum number of consecutive PTOs before the connection is torn down. // Maximum number of consecutive PTOs before the connection is torn down.
uint16_t maxNumPTOs{kDefaultMaxNumPTO}; uint16_t maxNumPTOs{kDefaultMaxNumPTO};
// Maximum number of connection ids to issue to peer
uint16_t maxNumMigrationsAllowed{kMaxNumMigrationsAllowed};
// Whether to listen to socket error // Whether to listen to socket error
bool enableSocketErrMsgCallback{true}; bool enableSocketErrMsgCallback{true};
// Whether pacing is enabled. // Whether pacing is enabled.