Skip to content

Commit e81b014

Browse files
hanidamlajmeta-codesync[bot]
authored andcommitted
rename http/2 settings WT_MAX_SESSIONS => WT_ENABLED
Summary: as per http/2 wt RFC: https://datatracker.ietf.org/doc/draft-ietf-webtrans-http2/ WT_MAX_SESSIONS is no longer the correct naming, it's now referred to as WT_ENABLED the existing WT_ENABLED is renamed to H3_WT_ENABLED to disambiguate Reviewed By: sharmafb Differential Revision: D112803356 fbshipit-source-id: b3cd3212dad1072654a7781c3d1fab91ab945199
1 parent f39c879 commit e81b014

7 files changed

Lines changed: 17 additions & 17 deletions

File tree

third-party/proxygen/src/proxygen/lib/http/codec/HQUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ folly::Optional<hq::SettingId> httpToHqSettingsId(proxygen::SettingsId id) {
9797
return hq::SettingId::H3_WT_MAX_SESSIONS;
9898
case proxygen::SettingsId::WT_INITIAL_MAX_DATA:
9999
return hq::SettingId::WT_INITIAL_MAX_DATA;
100-
case proxygen::SettingsId::WT_ENABLED:
100+
case proxygen::SettingsId::H3_WT_ENABLED:
101101
return hq::SettingId::WT_ENABLED;
102102
default:
103103
return folly::none; // this setting has no meaning in HQ
@@ -125,7 +125,7 @@ folly::Optional<proxygen::SettingsId> hqToHttpSettingsId(hq::SettingId id) {
125125
case hq::SettingId::WT_INITIAL_MAX_DATA:
126126
return proxygen::SettingsId::WT_INITIAL_MAX_DATA;
127127
case hq::SettingId::WT_ENABLED:
128-
return proxygen::SettingsId::WT_ENABLED;
128+
return proxygen::SettingsId::H3_WT_ENABLED;
129129
}
130130
return folly::none;
131131
}

third-party/proxygen/src/proxygen/lib/http/codec/HTTP2Codec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@ ErrorCode HTTP2Codec::handleSettings(const std::deque<SettingPair>& settings) {
817817
return ErrorCode::PROTOCOL_ERROR;
818818
}
819819
break;
820-
case SettingsId::WT_MAX_SESSIONS:
820+
case SettingsId::WT_ENABLED:
821821
case SettingsId::_HQ_QPACK_BLOCKED_STREAMS:
822822
case SettingsId::_HQ_DATAGRAM:
823823
case SettingsId::_HQ_DATAGRAM_RFC:
@@ -1451,7 +1451,7 @@ size_t HTTP2Codec::generateSettings(folly::IOBufQueue& writeBuf) {
14511451
continue;
14521452
}
14531453
break;
1454-
case SettingsId::WT_MAX_SESSIONS:
1454+
case SettingsId::WT_ENABLED:
14551455
case SettingsId::_HQ_QPACK_BLOCKED_STREAMS:
14561456
case SettingsId::_HQ_DATAGRAM:
14571457
case SettingsId::_HQ_DATAGRAM_RFC:

third-party/proxygen/src/proxygen/lib/http/codec/SettingsId.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ enum class SettingsId : uint64_t {
2626

2727
ENABLE_CONNECT_PROTOCOL = 8,
2828

29-
WT_MAX_SESSIONS = 0x2b60,
29+
WT_ENABLED = 0x2b60,
3030
WT_INITIAL_MAX_DATA = 0x2b61,
3131
WT_INITIAL_MAX_STREAM_DATA_UNI = 0x2b62,
3232
WT_INITIAL_MAX_STREAM_DATA_BIDI = 0x2b63,
@@ -42,7 +42,7 @@ enum class SettingsId : uint64_t {
4242
_HQ_DATAGRAM_RFC = HQ_SETTINGS_MASK | 0x33,
4343
ENABLE_WEBTRANSPORT = 0x2b603742,
4444
H3_WT_MAX_SESSIONS = 0x14e9cd29,
45-
WT_ENABLED = 0x2c7cf000,
45+
H3_WT_ENABLED = 0x2c7cf000,
4646
};
4747

4848
using SettingPair = std::pair<SettingsId, uint32_t>;

third-party/proxygen/src/proxygen/lib/http/codec/test/HTTP2CodecTest.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,11 +2597,11 @@ TEST_F(HTTP2CodecTest, GenerateHeadersWithEmptyRequest) {
25972597

25982598
TEST_F(HTTP2CodecTest, SetIfNotPresent) {
25992599
auto* egressSettings = CHECK_NOTNULL(downstreamCodec_.getEgressSettings());
2600-
// WT_MAX_SESSIONS not currently present
2601-
EXPECT_TRUE(egressSettings->setIfNotPresent(SettingsId::WT_MAX_SESSIONS, 1));
2600+
// WT_ENABLED not currently present
2601+
EXPECT_TRUE(egressSettings->setIfNotPresent(SettingsId::WT_ENABLED, 1));
26022602
// no-op since added above
2603-
EXPECT_FALSE(egressSettings->setIfNotPresent(SettingsId::WT_MAX_SESSIONS, 2));
2603+
EXPECT_FALSE(egressSettings->setIfNotPresent(SettingsId::WT_ENABLED, 2));
26042604
// expected value is 1
2605-
auto* wtMaxSessions = egressSettings->getSetting(SettingsId::WT_MAX_SESSIONS);
2606-
EXPECT_TRUE(wtMaxSessions && wtMaxSessions->value == 1);
2605+
auto* wtEnabled = egressSettings->getSetting(SettingsId::WT_ENABLED);
2606+
EXPECT_TRUE(wtEnabled && wtEnabled->value == 1);
26072607
}

third-party/proxygen/src/proxygen/lib/http/session/test/HQSessionTestCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class HQSessionTest
129129
egressSettings_.setSetting(proxygen::SettingsId::ENABLE_CONNECT_PROTOCOL,
130130
1);
131131
egressSettings_.setSetting(proxygen::SettingsId::ENABLE_WEBTRANSPORT, 1);
132-
egressSettings_.setSetting(proxygen::SettingsId::WT_ENABLED, 1);
132+
egressSettings_.setSetting(proxygen::SettingsId::H3_WT_ENABLED, 1);
133133
egressSettings_.setSetting(proxygen::SettingsId::WT_INITIAL_MAX_DATA,
134134
65536);
135135
}

third-party/proxygen/src/proxygen/lib/http/webtransport/WtUtils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void setEgressWtH3Settings(HTTPSettings& settings) noexcept {
8686
const bool supportsWt =
8787
settings.getSetting(SettingsId::ENABLE_CONNECT_PROTOCOL,
8888
/*defaultVal=*/0) &&
89-
settings.getSetting(SettingsId::WT_ENABLED, /*defaultVal=*/0);
89+
settings.getSetting(SettingsId::H3_WT_ENABLED, /*defaultVal=*/0);
9090
if (supportsWt) {
9191
settings.setIfNotPresent(SettingsId::WT_INITIAL_MAX_DATA, kWtInitMaxData);
9292
settings.setIfNotPresent(SettingsId::WT_INITIAL_MAX_STREAMS_UNI,
@@ -155,11 +155,11 @@ WtStreamManager::WtConfig getH3WtConfig(const HTTPSettings* ingress,
155155
bool supportsH2Wt(
156156
std::initializer_list<const HTTPSettings*> settings) noexcept {
157157
constexpr auto kEnableConnectProto = SettingsId::ENABLE_CONNECT_PROTOCOL;
158-
constexpr auto kEnableWtMaxSess = SettingsId::WT_MAX_SESSIONS;
158+
constexpr auto kWtEnabled = SettingsId::WT_ENABLED;
159159
return std::all_of(settings.begin(), settings.end(), [](auto* settings) {
160160
return settings &&
161161
settings->getSetting(kEnableConnectProto, /*defaultVal=*/0) &&
162-
settings->getSetting(kEnableWtMaxSess, /*defaultVal=*/0);
162+
settings->getSetting(kWtEnabled, /*defaultVal=*/0);
163163
});
164164
}
165165

@@ -169,7 +169,7 @@ bool supportsH3Wt(TransportDirection dir,
169169
const HTTPSettings* server = isUpstream(dir) ? ingress : egress;
170170
const HTTPSettings* client = isUpstream(dir) ? egress : ingress;
171171
bool serverOk = server &&
172-
server->getSetting(SettingsId::WT_ENABLED,
172+
server->getSetting(SettingsId::H3_WT_ENABLED,
173173
/*defaultVal=*/0) &&
174174
server->getSetting(SettingsId::ENABLE_CONNECT_PROTOCOL,
175175
/*defaultVal=*/0) &&

third-party/proxygen/src/proxygen/lib/http/webtransport/test/Mocks.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ struct DummyWtHandler : public WebTransportHandler {
192192

193193
// test utils
194194
static constexpr auto kWtSettings = {SettingsId::ENABLE_CONNECT_PROTOCOL,
195-
SettingsId::WT_MAX_SESSIONS};
195+
SettingsId::WT_ENABLED};
196196

197197
// hack to enable/disable wt on codec for tests
198198
inline void setCodecWtSettings(HTTPCodec& codec, bool enabled) noexcept {

0 commit comments

Comments
 (0)