You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/09/12 01:09:56 UTC
[trafficserver] 02/04: [draft-14] Split INITIAL_MAX_STREAM_DATA
into 3 transport parameters
This is an automated email from the ASF dual-hosted git repository.
masaori pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
commit 786ec670eb2336d3354b1276ad2c53ec34791bcd
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Mon Sep 10 13:47:36 2018 +0900
[draft-14] Split INITIAL_MAX_STREAM_DATA into 3 transport parameters
---
iocore/net/quic/QUICDebugNames.cc | 8 ++-
iocore/net/quic/QUICHandshake.cc | 15 +++--
iocore/net/quic/QUICStreamManager.cc | 70 ++++++++++++++++----
iocore/net/quic/QUICTransportParameters.cc | 75 +++++++++++++---------
iocore/net/quic/QUICTransportParameters.h | 4 +-
iocore/net/quic/test/test_QUICStreamManager.cc | 4 +-
.../net/quic/test/test_QUICTransportParameters.cc | 16 ++---
7 files changed, 128 insertions(+), 64 deletions(-)
diff --git a/iocore/net/quic/QUICDebugNames.cc b/iocore/net/quic/QUICDebugNames.cc
index 567266b..7b799bb 100644
--- a/iocore/net/quic/QUICDebugNames.cc
+++ b/iocore/net/quic/QUICDebugNames.cc
@@ -173,8 +173,8 @@ const char *
QUICDebugNames::transport_parameter_id(QUICTransportParameterId id)
{
switch (id) {
- case QUICTransportParameterId::INITIAL_MAX_STREAM_DATA:
- return "INITIAL_MAX_STREAM_DATA";
+ case QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL:
+ return "INITIAL_MAX_STREAM_DATA_BIDI_LOCAL";
case QUICTransportParameterId::INITIAL_MAX_DATA:
return "INITIAL_MAX_DATA";
case QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS:
@@ -193,6 +193,10 @@ QUICDebugNames::transport_parameter_id(QUICTransportParameterId id)
return "INITIAL_MAX_UNI_STREAMS";
case QUICTransportParameterId::DISABLE_MIGRATION:
return "DISABLE_MIGRATION";
+ case QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE:
+ return "INITIAL_MAX_STREAM_DATA_BIDI_REMOTE";
+ case QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI:
+ return "INITIAL_MAX_STREAM_DATA_UNI";
default:
return "UNKNOWN";
}
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 7865bf4..0349ab9 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -366,15 +366,18 @@ QUICHandshake::_load_local_server_transport_parameters(QUICVersion negotiated_ve
QUICTransportParametersInEncryptedExtensions *tp = new QUICTransportParametersInEncryptedExtensions(negotiated_version);
// MUSTs
- tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, params->initial_max_stream_data());
- tp->set(QUICTransportParameterId::INITIAL_MAX_DATA, params->initial_max_data());
tp->set(QUICTransportParameterId::IDLE_TIMEOUT, static_cast<uint16_t>(params->no_activity_timeout_in()));
- tp->set(QUICTransportParameterId::STATELESS_RESET_TOKEN, this->_reset_token.buf(), QUICStatelessResetToken::LEN);
- tp->add_version(QUIC_SUPPORTED_VERSIONS[0]);
// MAYs
+ tp->set(QUICTransportParameterId::INITIAL_MAX_DATA, params->initial_max_data());
tp->set(QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS, params->initial_max_bidi_streams_in());
tp->set(QUICTransportParameterId::INITIAL_MAX_UNI_STREAMS, params->initial_max_uni_streams_in());
+ tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, params->initial_max_stream_data());
+
+ // MAYs (server)
+ tp->set(QUICTransportParameterId::STATELESS_RESET_TOKEN, this->_reset_token.buf(), QUICStatelessResetToken::LEN);
+
+ tp->add_version(QUIC_SUPPORTED_VERSIONS[0]);
this->_local_transport_parameters = std::shared_ptr<QUICTransportParameters>(tp);
this->_hs_protocol->set_local_transport_parameters(this->_local_transport_parameters);
@@ -388,13 +391,13 @@ QUICHandshake::_load_local_client_transport_parameters(QUICVersion initial_versi
QUICTransportParametersInClientHello *tp = new QUICTransportParametersInClientHello(initial_version);
// MUSTs
- tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, params->initial_max_stream_data());
- tp->set(QUICTransportParameterId::INITIAL_MAX_DATA, params->initial_max_data());
tp->set(QUICTransportParameterId::IDLE_TIMEOUT, static_cast<uint16_t>(params->no_activity_timeout_out()));
// MAYs
+ tp->set(QUICTransportParameterId::INITIAL_MAX_DATA, params->initial_max_data());
tp->set(QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS, params->initial_max_bidi_streams_out());
tp->set(QUICTransportParameterId::INITIAL_MAX_UNI_STREAMS, params->initial_max_uni_streams_out());
+ tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, params->initial_max_stream_data());
this->_local_transport_parameters = std::shared_ptr<QUICTransportParameters>(tp);
this->_hs_protocol->set_local_transport_parameters(std::unique_ptr<QUICTransportParameters>(tp));
diff --git a/iocore/net/quic/QUICStreamManager.cc b/iocore/net/quic/QUICStreamManager.cc
index aa5d38a..a106ac1 100644
--- a/iocore/net/quic/QUICStreamManager.cc
+++ b/iocore/net/quic/QUICStreamManager.cc
@@ -259,26 +259,68 @@ QUICStreamManager::_find_or_create_stream(QUICStreamId stream_id)
{
QUICStream *stream = this->_find_stream(stream_id);
if (!stream) {
- QUICStreamType type = QUICTypeUtil::detect_stream_type(stream_id);
- if (type == QUICStreamType::CLIENT_BIDI && stream_id > this->_local_maximum_stream_id_bidi &&
- this->_local_maximum_stream_id_bidi != 0) {
- return nullptr;
- } else if (type == QUICStreamType::CLIENT_UNI && stream_id > this->_local_maximum_stream_id_uni &&
- this->_local_maximum_stream_id_uni != 0) {
- return nullptr;
- } else if (type == QUICStreamType::SERVER_BIDI && stream_id > this->_remote_maximum_stream_id_bidi &&
- this->_remote_maximum_stream_id_bidi != 0) {
- return nullptr;
- } else if (type == QUICStreamType::SERVER_UNI && stream_id > this->_remote_maximum_stream_id_uni &&
- this->_remote_maximum_stream_id_uni != 0) {
+ if (!this->_local_tp) {
return nullptr;
}
ink_assert(this->_local_tp);
ink_assert(this->_remote_tp);
- uint64_t local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA);
- uint64_t remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA);
+ uint64_t local_max_stream_data = 0;
+ uint64_t remote_max_stream_data = 0;
+
+ switch (QUICTypeUtil::detect_stream_type(stream_id)) {
+ case QUICStreamType::CLIENT_BIDI:
+ if (stream_id > this->_local_maximum_stream_id_bidi && this->_local_maximum_stream_id_bidi != 0) {
+ return nullptr;
+ }
+
+ if (this->_info->direction() == NET_VCONNECTION_OUT) {
+ // client
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
+ } else {
+ // server
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
+ }
+
+ break;
+ case QUICStreamType::CLIENT_UNI:
+ if (stream_id > this->_local_maximum_stream_id_uni && this->_local_maximum_stream_id_uni != 0) {
+ return nullptr;
+ }
+
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI);
+
+ break;
+ case QUICStreamType::SERVER_BIDI:
+ if (stream_id > this->_remote_maximum_stream_id_bidi && this->_remote_maximum_stream_id_bidi != 0) {
+ return nullptr;
+ }
+
+ if (this->_info->direction() == NET_VCONNECTION_OUT) {
+ // client
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
+ } else {
+ // server
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
+ }
+
+ break;
+ case QUICStreamType::SERVER_UNI:
+ if (stream_id > this->_remote_maximum_stream_id_uni && this->_remote_maximum_stream_id_uni != 0) {
+ return nullptr;
+ }
+
+ local_max_stream_data = this->_local_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI);
+ remote_max_stream_data = this->_remote_tp->getAsUInt32(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI);
+
+ break;
+ }
// TODO Free the stream somewhere
stream = THREAD_ALLOC(quicStreamAllocator, this_ethread());
diff --git a/iocore/net/quic/QUICTransportParameters.cc b/iocore/net/quic/QUICTransportParameters.cc
index 6797ab6..00dff4d 100644
--- a/iocore/net/quic/QUICTransportParameters.cc
+++ b/iocore/net/quic/QUICTransportParameters.cc
@@ -34,6 +34,11 @@
static constexpr int TRANSPORT_PARAMETERS_MAXIMUM_SIZE = 65535;
static constexpr char tag[] = "quic_handshake";
+static constexpr uint32_t TP_ERROR_LENGTH = 0x010000;
+static constexpr uint32_t TP_ERROR_VALUE = 0x020000;
+static constexpr uint32_t TP_ERROR_MUST_EXIST = 0x030000;
+static constexpr uint32_t TP_ERROR_MUST_NOT_EXIST = 0x040000;
+
QUICTransportParameters::Value::Value(const uint8_t *data, uint16_t len) : _len(len)
{
this->_data = static_cast<uint8_t *>(ats_malloc(len));
@@ -142,62 +147,70 @@ QUICTransportParameters::_validate_parameters() const
decltype(this->_parameters)::const_iterator ite;
// MUSTs
- if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA)) != this->_parameters.end()) {
- if (ite->second->len() != 4) {
- return -1;
+ if ((ite = this->_parameters.find(QUICTransportParameterId::IDLE_TIMEOUT)) != this->_parameters.end()) {
+ if (ite->second->len() != 2) {
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::IDLE_TIMEOUT);
+ }
+ if (QUICIntUtil::read_nbytes_as_uint(ite->second->data(), ite->second->len()) > 600) {
+ return -(TP_ERROR_VALUE | QUICTransportParameterId::IDLE_TIMEOUT);
}
} else {
- return -2;
+ return -(TP_ERROR_MUST_EXIST | QUICTransportParameterId::IDLE_TIMEOUT);
}
+ // MAYs
if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_DATA)) != this->_parameters.end()) {
if (ite->second->len() != 4) {
- return -3;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_DATA);
}
- } else {
- return -4;
}
- if ((ite = this->_parameters.find(QUICTransportParameterId::IDLE_TIMEOUT)) != this->_parameters.end()) {
+ if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS)) != this->_parameters.end()) {
if (ite->second->len() != 2) {
- return -5;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS);
}
- if (QUICIntUtil::read_nbytes_as_uint(ite->second->data(), ite->second->len()) > 600) {
- return -6;
+ }
+
+ if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_UNI_STREAMS)) != this->_parameters.end()) {
+ if (ite->second->len() != 2) {
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_UNI_STREAMS);
}
- } else {
- return -7;
}
- // MAYs
if ((ite = this->_parameters.find(QUICTransportParameterId::MAX_PACKET_SIZE)) != this->_parameters.end()) {
if (ite->second->len() != 2) {
- return -9;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::MAX_PACKET_SIZE);
}
if (QUICIntUtil::read_nbytes_as_uint(ite->second->data(), ite->second->len()) < 1200) {
- return -10;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::MAX_PACKET_SIZE);
}
}
if ((ite = this->_parameters.find(QUICTransportParameterId::ACK_DELAY_EXPONENT)) != this->_parameters.end()) {
if (ite->second->len() != 1) {
- return -11;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::ACK_DELAY_EXPONENT);
}
if (QUICIntUtil::read_nbytes_as_uint(ite->second->data(), ite->second->len()) > 20) {
- return -12;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::ACK_DELAY_EXPONENT);
}
}
- // MAYs
- if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_BIDI_STREAMS)) != this->_parameters.end()) {
- if (ite->second->len() != 2) {
- return -3;
+ // MAYs (initial values for the flow control on each type of stream)
+ if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL)) != this->_parameters.end()) {
+ if (ite->second->len() != 4) {
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
}
}
- if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_UNI_STREAMS)) != this->_parameters.end()) {
- if (ite->second->len() != 2) {
- return -5;
+ if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE)) != this->_parameters.end()) {
+ if (ite->second->len() != 4) {
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
+ }
+ }
+
+ if ((ite = this->_parameters.find(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI)) != this->_parameters.end()) {
+ if (ite->second->len() != 4) {
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_UNI);
}
}
@@ -374,18 +387,18 @@ QUICTransportParametersInClientHello::_validate_parameters() const
{
int res = QUICTransportParameters::_validate_parameters();
if (res < 0) {
- return res - 100;
+ return res;
}
decltype(this->_parameters)::const_iterator ite;
// MUST NOTs
if ((ite = this->_parameters.find(QUICTransportParameterId::STATELESS_RESET_TOKEN)) != this->_parameters.end()) {
- return -1;
+ return -(TP_ERROR_MUST_NOT_EXIST | QUICTransportParameterId::STATELESS_RESET_TOKEN);
}
if ((ite = this->_parameters.find(QUICTransportParameterId::PREFERRED_ADDRESS)) != this->_parameters.end()) {
- return -2;
+ return -(TP_ERROR_MUST_NOT_EXIST | QUICTransportParameterId::PREFERRED_ADDRESS);
}
return 0;
@@ -467,7 +480,7 @@ QUICTransportParametersInEncryptedExtensions::_validate_parameters() const
{
int res = QUICTransportParameters::_validate_parameters();
if (res < 0) {
- return res - 100;
+ return res;
}
decltype(this->_parameters)::const_iterator ite;
@@ -475,13 +488,13 @@ QUICTransportParametersInEncryptedExtensions::_validate_parameters() const
// MAYs
if ((ite = this->_parameters.find(QUICTransportParameterId::STATELESS_RESET_TOKEN)) != this->_parameters.end()) {
if (ite->second->len() != QUICStatelessResetToken::LEN) {
- return -1;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::STATELESS_RESET_TOKEN);
}
}
if ((ite = this->_parameters.find(QUICTransportParameterId::PREFERRED_ADDRESS)) != this->_parameters.end()) {
if (ite->second->len() < QUICPreferredAddress::MIN_LEN || QUICPreferredAddress::MAX_LEN < ite->second->len()) {
- return -3;
+ return -(TP_ERROR_LENGTH | QUICTransportParameterId::PREFERRED_ADDRESS);
}
}
diff --git a/iocore/net/quic/QUICTransportParameters.h b/iocore/net/quic/QUICTransportParameters.h
index aef3b69..f1b7a1e 100644
--- a/iocore/net/quic/QUICTransportParameters.h
+++ b/iocore/net/quic/QUICTransportParameters.h
@@ -34,7 +34,7 @@ class QUICTransportParameterId
{
public:
enum {
- INITIAL_MAX_STREAM_DATA = 0,
+ INITIAL_MAX_STREAM_DATA_BIDI_LOCAL = 0,
INITIAL_MAX_DATA,
INITIAL_MAX_BIDI_STREAMS,
IDLE_TIMEOUT,
@@ -44,6 +44,8 @@ public:
ACK_DELAY_EXPONENT,
INITIAL_MAX_UNI_STREAMS,
DISABLE_MIGRATION,
+ INITIAL_MAX_STREAM_DATA_BIDI_REMOTE,
+ INITIAL_MAX_STREAM_DATA_UNI,
};
explicit operator bool() const { return true; }
diff --git a/iocore/net/quic/test/test_QUICStreamManager.cc b/iocore/net/quic/test/test_QUICStreamManager.cc
index cf463a5..4711aa1 100644
--- a/iocore/net/quic/test/test_QUICStreamManager.cc
+++ b/iocore/net/quic/test/test_QUICStreamManager.cc
@@ -106,7 +106,7 @@ TEST_CASE("QUICStreamManager_total_offset_received", "[quic]")
QUICStreamManager sm(new MockQUICConnectionInfoProvider(), new MockQUICRTTProvider(), &app_map);
std::shared_ptr<QUICTransportParameters> local_tp =
std::make_shared<QUICTransportParametersInEncryptedExtensions>(static_cast<QUICVersion>(0));
- local_tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, UINT32_C(4096));
+ local_tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, UINT32_C(4096));
std::shared_ptr<QUICTransportParameters> remote_tp =
std::make_shared<QUICTransportParametersInClientHello>(static_cast<QUICVersion>(0));
sm.init_flow_control_params(local_tp, remote_tp);
@@ -135,7 +135,7 @@ TEST_CASE("QUICStreamManager_total_offset_sent", "[quic]")
QUICStreamManager sm(new MockQUICConnectionInfoProvider(), new MockQUICRTTProvider(), &app_map);
std::shared_ptr<QUICTransportParameters> local_tp =
std::make_shared<QUICTransportParametersInEncryptedExtensions>(static_cast<QUICVersion>(0));
- local_tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, UINT32_C(4096));
+ local_tp->set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, UINT32_C(4096));
std::shared_ptr<QUICTransportParameters> remote_tp =
std::make_shared<QUICTransportParametersInClientHello>(static_cast<QUICVersion>(0));
sm.init_flow_control_params(local_tp, remote_tp);
diff --git a/iocore/net/quic/test/test_QUICTransportParameters.cc b/iocore/net/quic/test/test_QUICTransportParameters.cc
index 4053ed2..8f56369 100644
--- a/iocore/net/quic/test/test_QUICTransportParameters.cc
+++ b/iocore/net/quic/test/test_QUICTransportParameters.cc
@@ -53,7 +53,7 @@ TEST_CASE("QUICTransportParametersInClientHello_read", "[quic]")
uint16_t len = 0;
const uint8_t *data = nullptr;
- data = params_in_ch.getAsBytes(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, len);
+ data = params_in_ch.getAsBytes(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, len);
CHECK(len == 4);
CHECK(memcmp(data, "\x11\x22\x33\x44", 4) == 0);
@@ -115,7 +115,7 @@ TEST_CASE("QUICTransportParametersInClientHello_write", "[quic]")
QUICTransportParametersInClientHello params_in_ch(0x05060708);
uint32_t max_stream_data = 0x11223344;
- params_in_ch.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, max_stream_data);
+ params_in_ch.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, max_stream_data);
uint16_t max_packet_size = 0xabcd;
params_in_ch.set(QUICTransportParameterId::MAX_PACKET_SIZE, max_packet_size);
@@ -137,7 +137,7 @@ TEST_CASE("QUICTransportParametersInEncryptedExtensions_read", "[quic]")
0x04, // size of supported versions
0x01, 0x02, 0x03, 0x04, //
0x00, 0x2a, // size of parameters
- 0x00, 0x00, // parameter id
+ 0x00, 0x0a, // parameter id
0x00, 0x04, // length of value
0x11, 0x22, 0x33, 0x44, // value
0x00, 0x01, // parameter id
@@ -159,7 +159,7 @@ TEST_CASE("QUICTransportParametersInEncryptedExtensions_read", "[quic]")
uint16_t len = 0;
const uint8_t *data = nullptr;
- data = params_in_ee.getAsBytes(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, len);
+ data = params_in_ee.getAsBytes(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, len);
CHECK(len == 4);
CHECK(memcmp(data, "\x11\x22\x33\x44", 4) == 0);
@@ -252,18 +252,18 @@ TEST_CASE("QUICTransportParametersEncryptedExtensions_write", "[quic]")
0x01, 0x02, 0x03, 0x04, // version 1
0x05, 0x06, 0x07, 0x08, // version 2
0x00, 0x0e, // size of parameters
- 0x00, 0x00, // parameter id
- 0x00, 0x04, // length of value
- 0x11, 0x22, 0x33, 0x44, // value
0x00, 0x05, // parameter id
0x00, 0x02, // length of value
0xab, 0xcd, // value
+ 0x00, 0x0a, // parameter id
+ 0x00, 0x04, // length of value
+ 0x11, 0x22, 0x33, 0x44, // value
};
QUICTransportParametersInEncryptedExtensions params_in_ee(0x01020304);
uint32_t max_stream_data = 0x11223344;
- params_in_ee.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA, max_stream_data);
+ params_in_ee.set(QUICTransportParameterId::INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, max_stream_data);
uint16_t max_packet_size = 0xabcd;
params_in_ee.set(QUICTransportParameterId::MAX_PACKET_SIZE, max_packet_size);