Skip to content

Commit 5d7de90

Browse files
authored
http: refactor async_client_impl to remove a data-member (envoyproxy#39945)
Minor refactor to remove the `runtime_` data member, and use the (same) one already stored by the shared-config. Risk Level: low Testing: N/A Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Adi Suissa-Peleg <[email protected]>
1 parent dfbe40d commit 5d7de90

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

source/common/http/async_client_impl.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ AsyncClientImpl::AsyncClientImpl(Upstream::ClusterInfoConstSharedPtr cluster,
3333
factory_context.api().randomGenerator(), std::move(shadow_writer), true, false, false,
3434
false, false, false, Protobuf::RepeatedPtrField<std::string>{}, dispatcher.timeSource(),
3535
http_context, router_context)),
36-
dispatcher_(dispatcher), runtime_(factory_context.runtime()),
37-
local_reply_(LocalReply::Factory::createDefault()) {}
36+
dispatcher_(dispatcher), local_reply_(LocalReply::Factory::createDefault()) {}
3837

3938
AsyncClientImpl::~AsyncClientImpl() {
4039
while (!active_streams_.empty()) {
@@ -375,7 +374,7 @@ AsyncRequestSharedImpl::AsyncRequestSharedImpl(AsyncClientImpl& parent,
375374
const AsyncClient::RequestOptions& options,
376375
absl::Status& creation_status)
377376
: AsyncStreamImpl(parent, *this, options, creation_status), callbacks_(callbacks),
378-
response_buffer_limit_(parent.runtime_.snapshot().getInteger(
377+
response_buffer_limit_(parent.config_->runtime_.snapshot().getInteger(
379378
AsyncClientImpl::ResponseBufferLimit, kBufferLimitForResponse)) {
380379
if (!creation_status.ok()) {
381380
return;

source/common/http/async_client_impl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ class AsyncClientImpl final : public AsyncClient {
8484
const Router::FilterConfigSharedPtr config_;
8585
Event::Dispatcher& dispatcher_;
8686
std::list<std::unique_ptr<AsyncStreamImpl>> active_streams_;
87-
Runtime::Loader& runtime_;
8887
const LocalReply::LocalReplyPtr local_reply_;
8988

9089
friend class AsyncStreamImpl;

0 commit comments

Comments
 (0)