Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions source/common/quic/client_connection_factory_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,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<Network::ClientConnection>
createQuicNetworkConnection(Http::PersistentQuicInfo& info, Event::Dispatcher& dispatcher,
Network::Address::InstanceConstSharedPtr server_addr,
Expand All @@ -77,15 +66,14 @@ 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.
// TODO(alyssawilk) pass in ClusterInfo::perConnectionBufferLimitBytes() for
// send_buffer_limit instead of using 0.
auto ret = std::make_unique<EnvoyQuicClientSession>(
info_impl->quic_config_, info_impl->supported_versions_, std::move(connection),
info_impl->server_id_, std::move(config), &static_info.push_promise_index_, dispatcher,
info_impl->server_id_, std::move(config), &info_impl->push_promise_index_, dispatcher,
/*send_buffer_limit=*/0);
return ret;
}
Expand Down
3 changes: 3 additions & 0 deletions source/common/quic/client_connection_factory_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ struct PersistentQuicInfoImpl : public Http::PersistentQuicInfo {
const quic::ParsedQuicVersionVector supported_versions_{quic::CurrentSupportedVersions()};
// TODO(alyssawilk) actually set this up properly.
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<Network::ClientConnection>
Expand Down