From d428eb17e715aae2d149af8974daac817ec929d0 Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Tue, 18 May 2021 14:22:00 -0400 Subject: [PATCH] http3: cleaning up TODO Signed-off-by: Alyssa Wilk --- .../common/quic/client_connection_factory_impl.cc | 14 +------------- .../common/quic/client_connection_factory_impl.h | 3 +++ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/source/common/quic/client_connection_factory_impl.cc b/source/common/quic/client_connection_factory_impl.cc index b8c3c2bd91906..c4c403dc6d2da 100644 --- a/source/common/quic/client_connection_factory_impl.cc +++ b/source/common/quic/client_connection_factory_impl.cc @@ -35,17 +35,6 @@ PersistentQuicInfoImpl::PersistentQuicInfoImpl( quiche::FlagRegistry::getInstance(); } -namespace { -// TODO(alyssawilk, danzh2010): This is mutable static info that is required for the QUICHE code. -// This was preexisting but should either be removed or potentially moved inside -// PersistentQuicInfoImpl. -struct StaticInfo { - quic::QuicClientPushPromiseIndex push_promise_index_; - - static StaticInfo& get() { MUTABLE_CONSTRUCT_ON_FIRST_USE(StaticInfo); } -}; -} // namespace - std::unique_ptr createQuicNetworkConnection(Http::PersistentQuicInfo& info, Event::Dispatcher& dispatcher, Network::Address::InstanceConstSharedPtr server_addr, @@ -58,7 +47,6 @@ createQuicNetworkConnection(Http::PersistentQuicInfo& info, Event::Dispatcher& d quic::QuicUtils::CreateRandomConnectionId(), server_addr, info_impl->conn_helper_, info_impl->alarm_factory_, quic::ParsedQuicVersionVector{info_impl->supported_versions_[0]}, local_addr, dispatcher, nullptr); - auto& static_info = StaticInfo::get(); ASSERT(!info_impl->supported_versions_.empty()); // QUICHE client session always use the 1st version to start handshake. @@ -66,7 +54,7 @@ createQuicNetworkConnection(Http::PersistentQuicInfo& info, Event::Dispatcher& d // send_buffer_limit instead of using 0. auto ret = std::make_unique( info_impl->quic_config_, info_impl->supported_versions_, std::move(connection), - info_impl->server_id_, info_impl->crypto_config_.get(), &static_info.push_promise_index_, + info_impl->server_id_, info_impl->crypto_config_.get(), &info_impl->push_promise_index_, dispatcher, /*send_buffer_limit=*/0); return ret; } diff --git a/source/common/quic/client_connection_factory_impl.h b/source/common/quic/client_connection_factory_impl.h index 3f736f596cdbf..ba07d93fcee6f 100644 --- a/source/common/quic/client_connection_factory_impl.h +++ b/source/common/quic/client_connection_factory_impl.h @@ -32,6 +32,9 @@ struct PersistentQuicInfoImpl : public Http::PersistentQuicInfo { // be updated with SDS. std::unique_ptr crypto_config_; quic::QuicConfig quic_config_; + // This arguably should not be shared across connections but as Envoy doesn't + // support push promise it's really moot point. + quic::QuicClientPushPromiseIndex push_promise_index_; }; std::unique_ptr