Skip to content

Commit

Permalink
win32
Browse files Browse the repository at this point in the history
Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com>
  • Loading branch information
junr03 committed Mar 14, 2022
1 parent 2b1c9cd commit 9c631ec
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions source/common/upstream/upstream_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,13 @@ ClusterInfoImpl::ClusterInfoImpl(
: absl::nullopt),
factory_context_(
std::make_unique<FactoryContextImpl>(*stats_scope_, runtime, factory_context)) {
#ifdef WIN32
if (set_local_interface_name_on_upstream_connections_) {
throw EnvoyException("set_local_interface_name_on_upstream_connections_ cannot be set to true"
"on Windows platforms");
}
#endif

if (config.has_max_requests_per_connection() &&
http_protocol_options_->common_http_protocol_options_.has_max_requests_per_connection()) {
throw EnvoyException("Only one of max_requests_per_connection from Cluster or "
Expand Down
9 changes: 6 additions & 3 deletions test/integration/protocol_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3665,7 +3665,13 @@ TEST_P(ProtocolIntegrationTest, LocalInterfaceNameForUpstreamConnection) {
->mutable_upstream_connection_options()
->set_set_local_interface_name_on_upstream_connections(true);
});
#ifdef WIN32
EXPECT_THROW_WITH_MESSAGE(initialize(), Envoy::EnvoyException,
"set_local_interface_name_on_upstream_connections_ cannot be set to "
"true on Windows platforms");
#else
initialize();
#endif

codec_client_ = makeHttpConnection(lookupPort("http"));

Expand All @@ -3682,9 +3688,6 @@ TEST_P(ProtocolIntegrationTest, LocalInterfaceNameForUpstreamConnection) {

// Make sure that the local interface name was populated due to runtime override.
// TODO: h3 upstreams don't have local interface name
#ifdef WIN32
EXPECT_TRUE(response->headers().get(Http::LowerCaseString("local_interface_name")).empty());
#else
if (GetParam().upstream_protocol == Http::CodecType::HTTP3) {
EXPECT_TRUE(response->headers().get(Http::LowerCaseString("local_interface_name")).empty());
} else {
Expand Down

0 comments on commit 9c631ec

Please sign in to comment.