Skip to content

Commit 2717ecc

Browse files
committed
Rename QUIC Transport Parameters
ORIGINAL_CONNECTION_ID -> ORIGINAL_DESTINATION_CONNECTION_ID MAX_PACKET_SIZE -> MAX_UDP_PAYLOAD_SIZE
1 parent 9ef2167 commit 2717ecc

5 files changed

Lines changed: 16 additions & 16 deletions

File tree

iocore/net/quic/QUICDebugNames.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@ QUICDebugNames::transport_parameter_id(QUICTransportParameterId id)
189189
return "MAX_IDLE_TIMEOUT";
190190
case QUICTransportParameterId::PREFERRED_ADDRESS:
191191
return "PREFERRED_ADDRESS";
192-
case QUICTransportParameterId::MAX_PACKET_SIZE:
193-
return "MAX_PACKET_SIZE";
192+
case QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE:
193+
return "MAX_UDP_PAYLOAD_SIZE";
194194
case QUICTransportParameterId::STATELESS_RESET_TOKEN:
195195
return "STATELESS_RESET_TOKEN";
196196
case QUICTransportParameterId::ACK_DELAY_EXPONENT:
@@ -205,8 +205,8 @@ QUICDebugNames::transport_parameter_id(QUICTransportParameterId id)
205205
return "INITIAL_MAX_STREAM_DATA_UNI";
206206
case QUICTransportParameterId::MAX_ACK_DELAY:
207207
return "INITIAL_MAX_ACK_DELAY";
208-
case QUICTransportParameterId::ORIGINAL_CONNECTION_ID:
209-
return "INITIAL_ORIGINAL_CONNECTION_ID";
208+
case QUICTransportParameterId::ORIGINAL_DESTINATION_CONNECTION_ID:
209+
return "INITIAL_ORIGINAL_DESTINATION_CONNECTION_ID";
210210
case QUICTransportParameterId::ACTIVE_CONNECTION_ID_LIMIT:
211211
return "ACTIVE_CONNECTION_ID_LIMIT";
212212
default:

iocore/net/quic/QUICHandshake.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ QUICHandshake::_load_local_server_transport_parameters(const QUICTPConfig &tp_co
386386
// MUSTs
387387
tp->set(QUICTransportParameterId::MAX_IDLE_TIMEOUT, static_cast<uint16_t>(tp_config.no_activity_timeout()));
388388
if (this->_stateless_retry) {
389-
tp->set(QUICTransportParameterId::ORIGINAL_CONNECTION_ID, this->_qc->first_connection_id(),
389+
tp->set(QUICTransportParameterId::ORIGINAL_DESTINATION_CONNECTION_ID, this->_qc->first_connection_id(),
390390
this->_qc->first_connection_id().length());
391391
}
392392

iocore/net/quic/QUICTransportParameters.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ QUICTransportParameters::_validate_parameters() const
159159
if ((ite = this->_parameters.find(QUICTransportParameterId::MAX_IDLE_TIMEOUT)) != this->_parameters.end()) {
160160
}
161161

162-
if ((ite = this->_parameters.find(QUICTransportParameterId::MAX_PACKET_SIZE)) != this->_parameters.end()) {
162+
if ((ite = this->_parameters.find(QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE)) != this->_parameters.end()) {
163163
if (QUICIntUtil::read_nbytes_as_uint(ite->second->data(), ite->second->len()) < 1200) {
164-
return -(TP_ERROR_VALUE | QUICTransportParameterId::MAX_PACKET_SIZE);
164+
return -(TP_ERROR_VALUE | QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE);
165165
}
166166
}
167167

@@ -372,11 +372,11 @@ QUICTransportParametersInEncryptedExtensions::_validate_parameters() const
372372
decltype(this->_parameters)::const_iterator ite;
373373

374374
// MUSTs if the server sent a Retry packet
375-
if ((ite = this->_parameters.find(QUICTransportParameterId::ORIGINAL_CONNECTION_ID)) != this->_parameters.end()) {
375+
if ((ite = this->_parameters.find(QUICTransportParameterId::ORIGINAL_DESTINATION_CONNECTION_ID)) != this->_parameters.end()) {
376376
// We cannot check the length because it's not a fixed length.
377377
} else {
378378
// TODO Need a way that checks if we received a Retry from the server
379-
// return -(TP_ERROR_MUST_EXIST | QUICTransportParameterId::ORIGINAL_CONNECTION_ID);
379+
// return -(TP_ERROR_MUST_EXIST | QUICTransportParameterId::ORIGINAL_DESTINATION_CONNECTION_ID);
380380
}
381381

382382
// MAYs

iocore/net/quic/QUICTransportParameters.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ class QUICTransportParameterId
3434
{
3535
public:
3636
enum {
37-
ORIGINAL_CONNECTION_ID,
37+
ORIGINAL_DESTINATION_CONNECTION_ID,
3838
MAX_IDLE_TIMEOUT,
3939
STATELESS_RESET_TOKEN,
40-
MAX_PACKET_SIZE,
40+
MAX_UDP_PAYLOAD_SIZE,
4141
INITIAL_MAX_DATA,
4242
INITIAL_MAX_STREAM_DATA_BIDI_LOCAL,
4343
INITIAL_MAX_STREAM_DATA_BIDI_REMOTE,

iocore/net/quic/test/test_QUICTransportParameters.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TEST_CASE("QUICTransportParametersInClientHello_read", "[quic]")
5050
uint16_t len = 0;
5151
const uint8_t *data = nullptr;
5252

53-
data = params_in_ch.getAsBytes(QUICTransportParameterId::ORIGINAL_CONNECTION_ID, len);
53+
data = params_in_ch.getAsBytes(QUICTransportParameterId::ORIGINAL_DESTINATION_CONNECTION_ID, len);
5454
CHECK(len == 4);
5555
CHECK(memcmp(data, "\x11\x22\x33\x44", 4) == 0);
5656

@@ -62,7 +62,7 @@ TEST_CASE("QUICTransportParametersInClientHello_read", "[quic]")
6262
CHECK(len == 2);
6363
CHECK(memcmp(data, "\x0a\x0b", 2) == 0);
6464

65-
data = params_in_ch.getAsBytes(QUICTransportParameterId::MAX_PACKET_SIZE, len);
65+
data = params_in_ch.getAsBytes(QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE, len);
6666
CHECK(len == 2);
6767
CHECK(memcmp(data, "\x05\x67", 2) == 0);
6868

@@ -111,7 +111,7 @@ TEST_CASE("QUICTransportParametersInClientHello_write", "[quic]")
111111
params_in_ch.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, max_stream_data);
112112

113113
uint16_t max_packet_size = 0x1bcd;
114-
params_in_ch.set(QUICTransportParameterId::MAX_PACKET_SIZE, max_packet_size);
114+
params_in_ch.set(QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE, max_packet_size);
115115

116116
uint8_t stateless_reset_token[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
117117
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77};
@@ -242,7 +242,7 @@ TEST_CASE("QUICTransportParametersEncryptedExtensions_write", "[quic]")
242242
params_in_ee.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, max_stream_data);
243243

244244
uint16_t max_packet_size = 0x1bcd;
245-
params_in_ee.set(QUICTransportParameterId::MAX_PACKET_SIZE, max_packet_size);
245+
params_in_ee.set(QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE, max_packet_size);
246246

247247
params_in_ee.add_version(0x01020304);
248248
params_in_ee.add_version(0x05060708);
@@ -273,7 +273,7 @@ TEST_CASE("QUICTransportParametersEncryptedExtensions_write", "[quic]")
273273
params_in_ee.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, max_stream_data);
274274

275275
uint16_t max_packet_size = 0x1bcd;
276-
params_in_ee.set(QUICTransportParameterId::MAX_PACKET_SIZE, max_packet_size);
276+
params_in_ee.set(QUICTransportParameterId::MAX_UDP_PAYLOAD_SIZE, max_packet_size);
277277
params_in_ee.set(QUICTransportParameterId::DISABLE_ACTIVE_MIGRATION, nullptr, 0);
278278

279279
params_in_ee.add_version(0x01020304);

0 commit comments

Comments
 (0)