Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
3 changes: 2 additions & 1 deletion source/common/common/stl_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ std::string accumulateToString(const ContainerT& source,
if (source.empty()) {
return "[]";
}
return std::accumulate(std::next(source.begin()), source.end(), "[" + string_func(source[0]),
return std::accumulate(std::next(source.begin()), source.end(),
"[" + string_func(*source.begin()),
[string_func](std::string acc, const T& element) {
return acc + ", " + string_func(element);
}) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "envoy/extensions/common/dynamic_forward_proxy/v3/dns_cache.pb.h"

#include "source/common/common/stl_helpers.h"
#include "source/common/config/utility.h"
#include "source/common/http/utility.h"
#include "source/common/network/resolver_impl.h"
Expand Down Expand Up @@ -289,7 +290,10 @@ void DnsCacheImpl::finishResolve(const std::string& host,
Network::DnsResolver::ResolutionStatus status,
std::list<Network::DnsResponse>&& response, bool from_cache) {
ASSERT(main_thread_dispatcher_.isThreadSafe());
ENVOY_LOG(debug, "main thread resolve complete for host '{}'. {} results", host, response.size());
ENVOY_LOG_EVENT(debug, "main thread resolve complete for host '{}': {}", host,
accumulateToString<Network::DnsResponse>(response, [](const auto& dns_response) {
return dns_response.address_->asString();
}));

// Functions like this one that modify primary_hosts_ are only called in the main thread so we
// know it is safe to use the PrimaryHostInfo pointers outside of the lock.
Expand Down