aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2018-03-12 12:08:30 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2018-03-12 12:08:30 -0700
commit7b84b3d519b0fb678876af10c0bc2206020dbe91 (patch)
treed27027da72a1b3451ecf5718c835f12d5b2f26ca /src/core/ext/filters
parentc7c0d69d8b411f1c5102bfd186aa2f6992c2e59c (diff)
PR comments
Diffstat (limited to 'src/core/ext/filters')
-rw-r--r--src/core/ext/filters/client_channel/client_channel_plugin.cc27
-rw-r--r--src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc4
2 files changed, 4 insertions, 27 deletions
diff --git a/src/core/ext/filters/client_channel/client_channel_plugin.cc b/src/core/ext/filters/client_channel/client_channel_plugin.cc
index ed3ebd2696..98d9d02110 100644
--- a/src/core/ext/filters/client_channel/client_channel_plugin.cc
+++ b/src/core/ext/filters/client_channel/client_channel_plugin.cc
@@ -39,31 +39,6 @@ static bool append_filter(grpc_channel_stack_builder* builder, void* arg) {
builder, static_cast<const grpc_channel_filter*>(arg), nullptr, nullptr);
}
-// Only used for direct channels, as they don't create subchannels, which is
-// where default authority is handled for regular channels.
-static bool set_default_host_if_unset(grpc_channel_stack_builder* builder,
- void* unused) {
- const grpc_channel_args* args =
- grpc_channel_stack_builder_get_channel_arguments(builder);
- for (size_t i = 0; i < args->num_args; i++) {
- if (0 == strcmp(args->args[i].key, GRPC_ARG_DEFAULT_AUTHORITY) ||
- 0 == strcmp(args->args[i].key, GRPC_SSL_TARGET_NAME_OVERRIDE_ARG)) {
- return true;
- }
- }
- grpc_core::UniquePtr<char> default_authority =
- grpc_core::ResolverRegistry::GetDefaultAuthority(
- grpc_channel_stack_builder_get_target(builder));
- if (default_authority.get() != nullptr) {
- grpc_arg arg = grpc_channel_arg_string_create(
- (char*)GRPC_ARG_DEFAULT_AUTHORITY, default_authority.get());
- grpc_channel_args* new_args = grpc_channel_args_copy_and_add(args, &arg, 1);
- grpc_channel_stack_builder_set_channel_arguments(builder, new_args);
- grpc_channel_args_destroy(new_args);
- }
- return true;
-}
-
void grpc_client_channel_init(void) {
grpc_core::LoadBalancingPolicyRegistry::Builder::InitRegistry();
grpc_core::ResolverRegistry::Builder::InitRegistry();
@@ -71,8 +46,6 @@ void grpc_client_channel_init(void) {
grpc_proxy_mapper_registry_init();
grpc_register_http_proxy_mapper();
grpc_subchannel_index_init();
- grpc_channel_init_register_stage(GRPC_CLIENT_DIRECT_CHANNEL, INT_MIN,
- set_default_host_if_unset, nullptr);
grpc_channel_init_register_stage(
GRPC_CLIENT_CHANNEL, GRPC_CHANNEL_INIT_BUILTIN_PRIORITY, append_filter,
(void*)&grpc_client_channel_filter);
diff --git a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
index 49918e11b7..17ab0febb7 100644
--- a/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
+++ b/src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc
@@ -983,6 +983,10 @@ grpc_channel_args* BuildBalancerChannelArgs(
// authority table (see \a grpc_lb_policy_grpclb_modify_lb_channel_args),
// as opposed to the authority from the parent channel.
GRPC_ARG_DEFAULT_AUTHORITY,
+ // Just as for \a GRPC_ARG_DEFAULT_AUTHORITY, the LB channel should be
+ // treated as a stand-alone channel and not inherit this argument from the
+ // args of the parent channel.
+ GRPC_SSL_TARGET_NAME_OVERRIDE_ARG,
};
// Channel args to add.
const grpc_arg args_to_add[] = {