Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various win32 compile issues #9915

Merged
merged 5 commits into from
Feb 4, 2020
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
2 changes: 1 addition & 1 deletion bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
}),
)
Expand Down
11 changes: 6 additions & 5 deletions source/common/upstream/load_balancer_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Envoy::Upstream::HostSet>& 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<size_t>(0),
[](size_t acc, const std::unique_ptr<Envoy::Upstream::HostSet>& host_set) {
return acc + host_set->hosts().size();
});

if (0 == total_hosts_count) {
// Backend is empty, but load must be distributed somewhere.
Expand Down
4 changes: 2 additions & 2 deletions source/extensions/transport_sockets/tls/context_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,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(""));
}
}
Expand Down Expand Up @@ -1096,7 +1096,7 @@ ServerContextImpl::generateHashForSessionContextId(const std::vector<std::string
static_assert(session_id.size() == SHA256_DIGEST_LENGTH, "hash size mismatch");
static_assert(session_id.size() == SSL_MAX_SSL_SESSION_ID_LENGTH, "TLS session ID size mismatch");

rc = EVP_DigestFinal(md.get(), session_id.begin(), &hash_length);
rc = EVP_DigestFinal(md.get(), session_id.data(), &hash_length);
RELEASE_ASSERT(rc == 1, Utility::getLastCryptoError().value_or(""));
RELEASE_ASSERT(hash_length == session_id.size(),
"SHA256 hash length must match TLS Session ID size");
Expand Down
6 changes: 6 additions & 0 deletions test/common/filesystem/directory_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@ TEST_F(DirectoryTest, DirectoryWithBrokenSymlink) {
const EntrySet expected = {
{".", FileType::Directory},
{"..", FileType::Directory},
#ifndef WIN32
// On Linux, a broken directory link is simply a symlink to be rm'ed
{"link_dir", FileType::Regular},
#else
// On Windows, a broken directory link remains a directory link to be rmdir'ed
{"link_dir", FileType::Directory},
#endif
};
EXPECT_EQ(expected, getDirectoryContents(dir_path_, false));
}
Expand Down
1 change: 1 addition & 0 deletions tools/spelling_dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ resync
ret
retriable
retriggers
rmdir
rollout
roundtrip
rpcs
Expand Down