Abort if direct channel doesn't provide default authority ch arg

reviewable/pr14615/r6
David Garcia Quintas 7 years ago
parent aa843f2bfc
commit 2f6fc700de
  1. 8
      Makefile
  2. 7
      src/core/lib/surface/channel.cc

@ -3160,7 +3160,6 @@ LIBGRPC_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@ -3438,6 +3437,7 @@ LIBGRPC_SRC = \
src/core/ext/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/plugin_registry/grpc_plugin_registry.cc \
@ -3538,7 +3538,6 @@ LIBGRPC_CRONET_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@ -3906,7 +3905,6 @@ LIBGRPC_TEST_UTIL_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@ -4189,7 +4187,6 @@ LIBGRPC_TEST_UTIL_UNSECURE_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@ -4439,7 +4436,6 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \
@ -4652,6 +4648,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/census/grpc_context.cc \
src/core/ext/filters/max_age/max_age_filter.cc \
src/core/ext/filters/message_size/message_size_filter.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc \
src/core/ext/filters/workarounds/workaround_utils.cc \
src/core/plugin_registry/grpc_unsecure_plugin_registry.cc \
@ -5242,7 +5239,6 @@ LIBGRPC++_CRONET_SRC = \
src/core/lib/channel/channel_args.cc \
src/core/lib/channel/channel_stack.cc \
src/core/lib/channel/channel_stack_builder.cc \
src/core/lib/channel/client_authority_filter.cc \
src/core/lib/channel/connected_channel.cc \
src/core/lib/channel/handshaker.cc \
src/core/lib/channel/handshaker_factory.cc \

@ -157,9 +157,10 @@ static grpc_core::UniquePtr<char> get_default_authority(
}
if (channel_stack_type == GRPC_CLIENT_DIRECT_CHANNEL &&
default_authority == nullptr) {
// Set the default authority. This is handled by the subchannel stack for
// regular client channels.
default_authority.reset(gpr_strdup(target));
gpr_log(GPR_ERROR,
"Direct channels must specify a value for the "
"GRPC_ARG_DEFAULT_AUTHORITY channel arg.");
abort();
}
return default_authority;
}

Loading…
Cancel
Save