From 7fe8b23af6018f4d93b7a0804bb634e119d7a7f6 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Mon, 3 Feb 2020 18:54:04 -0600 Subject: [PATCH] Fix various win32 compile issues (#9915) Signed-off-by: Sunjay Bhatia Signed-off-by: William A Rowe Jr --- bazel/foreign_cc/BUILD | 2 +- source/common/upstream/load_balancer_impl.cc | 11 ++++++----- .../extensions/transport_sockets/tls/context_impl.cc | 4 ++-- test/common/filesystem/directory_test.cc | 6 ++++++ tools/spelling_dictionary.txt | 1 + 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/bazel/foreign_cc/BUILD b/bazel/foreign_cc/BUILD index f820d83f134f..afec2a32463e 100644 --- a/bazel/foreign_cc/BUILD +++ b/bazel/foreign_cc/BUILD @@ -132,11 +132,11 @@ envoy_cmake_external( "//bazel:windows_x86_64": [ "event.lib", "event_core.lib", - "event_extra.lib", ], "//conditions:default": [ "libevent.a", "libevent_pthreads.a", + "libevent_core.a", ], }), ) diff --git a/source/common/upstream/load_balancer_impl.cc b/source/common/upstream/load_balancer_impl.cc index 177acddbd133..2de5a21d870a 100644 --- a/source/common/upstream/load_balancer_impl.cc +++ b/source/common/upstream/load_balancer_impl.cc @@ -280,11 +280,12 @@ void LoadBalancerBase::recalculatePerPriorityPanic() { void LoadBalancerBase::recalculateLoadInTotalPanic() { // First calculate total number of hosts across all priorities regardless // whether they are healthy or not. - const uint32_t total_hosts_count = std::accumulate( - priority_set_.hostSetsPerPriority().begin(), priority_set_.hostSetsPerPriority().end(), 0, - [](size_t acc, const std::unique_ptr& host_set) { - return acc + host_set->hosts().size(); - }); + const uint32_t total_hosts_count = + std::accumulate(priority_set_.hostSetsPerPriority().begin(), + priority_set_.hostSetsPerPriority().end(), static_cast(0), + [](size_t acc, const std::unique_ptr& host_set) { + return acc + host_set->hosts().size(); + }); if (0 == total_hosts_count) { // Backend is empty, but load must be distributed somewhere. diff --git a/source/extensions/transport_sockets/tls/context_impl.cc b/source/extensions/transport_sockets/tls/context_impl.cc index 0f6ce25cd01f..907ad4720c5d 100644 --- a/source/extensions/transport_sockets/tls/context_impl.cc +++ b/source/extensions/transport_sockets/tls/context_impl.cc @@ -1025,7 +1025,7 @@ ServerContextImpl::ServerContextImpl(Stats::Scope& scope, } int rc = - SSL_CTX_set_session_id_context(ctx.ssl_ctx_.get(), session_id.begin(), session_id.size()); + SSL_CTX_set_session_id_context(ctx.ssl_ctx_.get(), session_id.data(), session_id.size()); RELEASE_ASSERT(rc == 1, Utility::getLastCryptoError().value_or("")); } } @@ -1156,7 +1156,7 @@ ServerContextImpl::generateHashForSessionContextId(const std::vector