Skip to content

Commit

Permalink
Remove unused TPCC QuicTag and rename the variables
Browse files Browse the repository at this point in the history
* kORBT -> kOBIT
* kMIBS -> kMIDS
to match their on-the-wire value.

PiperOrigin-RevId: 695949206
  • Loading branch information
RyanTheOptimist authored and copybara-github committed Nov 13, 2024
1 parent b9fc6ed commit 3aac2d2
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion quiche/quic/core/crypto/crypto_handshake_message.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ std::string CryptoHandshakeMessage::DebugStringInternal(size_t indent) const {
case kSFCW:
case kIRTT:
case kMIUS:
case kMIBS:
case kMIDS:
case kTCID:
case kMAD:
// uint32_t value
Expand Down
8 changes: 3 additions & 5 deletions quiche/quic/core/crypto/crypto_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using ServerConfigID = std::string;
// "QNZR", "B2HI", "H2PR", "FIFO", "LIFO", "RRWS", "QNSP", "B2CL", "CHSP",
// "BPTE", "ACKD", "AKD2", "AKD4", "MAD1", "MAD4", "MAD5", "ACD0", "ACKQ",
// "TLPR", "CCS\0", "PDP4", "NCHP", "NBPE", "2RTO", "3RTO", "4RTO", "6RTO",
// "PDP1", "PDP2", "PDP3", "PDP5", "QLVE", "RVCM", "BBPD"
// "PDP1", "PDP2", "PDP3", "PDP5", "QLVE", "RVCM", "BBPD", "TPC\0"

// clang-format off
const QuicTag kCHLO = TAG('C', 'H', 'L', 'O'); // Client hello
Expand Down Expand Up @@ -129,8 +129,6 @@ const QuicTag kBBHI = TAG('B', 'B', 'H', 'I'); // Increase inflight_hi in
// PROBE_UP if ever inflight_hi
// limited in round
const QuicTag kRENO = TAG('R', 'E', 'N', 'O'); // Reno Congestion Control
const QuicTag kTPCC = TAG('P', 'C', 'C', '\0'); // Performance-Oriented
// Congestion Control
const QuicTag kBYTE = TAG('B', 'Y', 'T', 'E'); // TCP cubic or reno in bytes
const QuicTag kIW03 = TAG('I', 'W', '0', '3'); // Force ICWND to 3
const QuicTag kIW10 = TAG('I', 'W', '1', '0'); // Force ICWND to 10
Expand Down Expand Up @@ -389,7 +387,7 @@ const QuicTag kAEAD = TAG('A', 'E', 'A', 'D'); // Authenticated
const QuicTag kCOPT = TAG('C', 'O', 'P', 'T'); // Connection options
const QuicTag kCLOP = TAG('C', 'L', 'O', 'P'); // Client connection options
const QuicTag kICSL = TAG('I', 'C', 'S', 'L'); // Idle network timeout
const QuicTag kMIBS = TAG('M', 'I', 'D', 'S'); // Max incoming bidi streams
const QuicTag kMIDS = TAG('M', 'I', 'D', 'S'); // Max incoming bidi streams
const QuicTag kMIUS = TAG('M', 'I', 'U', 'S'); // Max incoming unidi streams
const QuicTag kADE = TAG('A', 'D', 'E', 0); // Ack Delay Exponent (IETF
// QUIC ACK Frame Only).
Expand All @@ -401,7 +399,7 @@ const QuicTag kSNI = TAG('S', 'N', 'I', '\0'); // Server name
// indication
const QuicTag kPUBS = TAG('P', 'U', 'B', 'S'); // Public key values
const QuicTag kSCID = TAG('S', 'C', 'I', 'D'); // Server config id
const QuicTag kORBT = TAG('O', 'B', 'I', 'T'); // Server orbit.
const QuicTag kOBIT = TAG('O', 'B', 'I', 'T'); // Server orbit.
const QuicTag kPDMD = TAG('P', 'D', 'M', 'D'); // Proof demand.
const QuicTag kPROF = TAG('P', 'R', 'O', 'F'); // Proof (signature).
const QuicTag kCCRT = TAG('C', 'C', 'R', 'T'); // Cached certificate
Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/core/crypto/crypto_server_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class CryptoServerTest : public QuicTestWithParam<TestParams> {
config_.AddConfig(primary_config, clock_.WallNow()));

absl::string_view orbit;
QUICHE_CHECK(msg->GetStringPiece(kORBT, &orbit));
QUICHE_CHECK(msg->GetStringPiece(kOBIT, &orbit));
QUICHE_CHECK_EQ(sizeof(orbit_), orbit.size());
memcpy(orbit_, orbit.data(), orbit.size());

Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/core/crypto/quic_crypto_client_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
}

absl::string_view orbit;
if (!scfg->GetStringPiece(kORBT, &orbit) || orbit.size() != kOrbitSize) {
if (!scfg->GetStringPiece(kOBIT, &orbit) || orbit.size() != kOrbitSize) {
*error_details = "SCFG missing OBIT";
return QUIC_CRYPTO_MESSAGE_PARAMETER_NOT_FOUND;
}
Expand Down
6 changes: 3 additions & 3 deletions quiche/quic/core/crypto/quic_crypto_server_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ QuicServerConfigProtobuf QuicCryptoServerConfig::GenerateConfig(
QUICHE_DCHECK(options.orbit.empty());
rand->RandBytes(orbit_bytes, sizeof(orbit_bytes));
}
msg.SetStringPiece(kORBT,
msg.SetStringPiece(kOBIT,
absl::string_view(orbit_bytes, sizeof(orbit_bytes)));

if (options.channel_id_enabled) {
Expand Down Expand Up @@ -1630,8 +1630,8 @@ QuicCryptoServerConfig::ParseConfigProtobuf(
}

absl::string_view orbit;
if (!msg->GetStringPiece(kORBT, &orbit)) {
QUIC_LOG(WARNING) << "Server config message is missing ORBT";
if (!msg->GetStringPiece(kOBIT, &orbit)) {
QUIC_LOG(WARNING) << "Server config message is missing OBIT";
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/core/quic_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ QuicConfig::QuicConfig()
connection_options_(kCOPT, PRESENCE_OPTIONAL),
client_connection_options_(kCLOP, PRESENCE_OPTIONAL),
max_idle_timeout_to_send_(QuicTime::Delta::Infinite()),
max_bidirectional_streams_(kMIBS, PRESENCE_REQUIRED),
max_bidirectional_streams_(kMIDS, PRESENCE_REQUIRED),
max_unidirectional_streams_(kMIUS, PRESENCE_OPTIONAL),
bytes_for_connection_id_(kTCID, PRESENCE_OPTIONAL),
initial_round_trip_time_us_(kIRTT, PRESENCE_OPTIONAL),
Expand Down
4 changes: 2 additions & 2 deletions quiche/quic/core/quic_config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ TEST_P(QuicConfigTest, MissingOptionalValuesInCHLO) {

// Set all REQUIRED tags.
msg.SetValue(kICSL, 1);
msg.SetValue(kMIBS, 1);
msg.SetValue(kMIDS, 1);

// No error, as rest are optional.
std::string error_details;
Expand All @@ -263,7 +263,7 @@ TEST_P(QuicConfigTest, MissingOptionalValuesInSHLO) {

// Set all REQUIRED tags.
msg.SetValue(kICSL, 1);
msg.SetValue(kMIBS, 1);
msg.SetValue(kMIDS, 1);

// No error, as rest are optional.
std::string error_details;
Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/test_tools/crypto_test_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ std::string GenerateClientNonceHex(const QuicClock* clock,
std::unique_ptr<CryptoHandshakeMessage> msg =
crypto_config->AddConfig(primary_config, clock->WallNow());
absl::string_view orbit;
QUICHE_CHECK(msg->GetStringPiece(kORBT, &orbit));
QUICHE_CHECK(msg->GetStringPiece(kOBIT, &orbit));
std::string nonce;
CryptoUtils::GenerateNonce(clock->WallNow(), QuicRandom::GetInstance(), orbit,
&nonce);
Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/test_tools/crypto_test_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ TEST_F(CryptoTestUtilsTest, TestGenerateFullCHLO) {
std::unique_ptr<CryptoHandshakeMessage> msg =
crypto_config.AddConfig(primary_config, clock.WallNow());
absl::string_view orbit;
ASSERT_TRUE(msg->GetStringPiece(kORBT, &orbit));
ASSERT_TRUE(msg->GetStringPiece(kOBIT, &orbit));
std::string nonce;
CryptoUtils::GenerateNonce(clock.WallNow(), QuicRandom::GetInstance(), orbit,
&nonce);
Expand Down
2 changes: 1 addition & 1 deletion quiche/quic/test_tools/simulator/quic_endpoint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ QuicEndpoint::QuicEndpoint(Simulator* simulator, std::string name,
CryptoHandshakeMessage peer_hello;
peer_hello.SetValue(kICSL,
static_cast<uint32_t>(kMaximumIdleTimeoutSecs - 1));
peer_hello.SetValue(kMIBS,
peer_hello.SetValue(kMIDS,
static_cast<uint32_t>(kDefaultMaxStreamsPerConnection));
QuicConfig config;
QuicErrorCode error_code = config.ProcessPeerHello(
Expand Down

0 comments on commit 3aac2d2

Please sign in to comment.