diff options
author | 2018-03-21 13:18:22 -0700 | |
---|---|---|
committer | 2018-03-21 13:18:22 -0700 | |
commit | 31e957632fc59457b061f72e98951e293c8c0851 (patch) | |
tree | 2f6429ef1ea5d16d4af146b475d521c0911ca1bd | |
parent | 961353ab6d1b48da74e307f805f45509c4a7de7f (diff) |
Moved assertion for GRPC_ARG_DEFAULT_AUTHORITY into the authority filter
-rw-r--r-- | src/core/ext/filters/http/client_authority_filter.cc | 8 | ||||
-rw-r--r-- | src/core/lib/surface/channel.cc | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/core/ext/filters/http/client_authority_filter.cc b/src/core/ext/filters/http/client_authority_filter.cc index 5294cfdcc5..f2b3e0fe7b 100644 --- a/src/core/ext/filters/http/client_authority_filter.cc +++ b/src/core/ext/filters/http/client_authority_filter.cc @@ -90,7 +90,13 @@ grpc_error* init_channel_elem(grpc_channel_element* elem, channel_data* chand = static_cast<channel_data*>(elem->channel_data); const grpc_arg* default_authority_arg = grpc_channel_args_find(args->channel_args, GRPC_ARG_DEFAULT_AUTHORITY); - GPR_ASSERT(default_authority_arg != nullptr); + if (default_authority_arg == nullptr) { + gpr_log( + GPR_ERROR, + "GRPC_ARG_DEFAULT_AUTHORITY channel arg. not found. Note that direct " + "channels must explicity specify a value for this argument."); + abort(); + } chand->default_authority = grpc_slice_from_copied_string( grpc_channel_arg_get_string(default_authority_arg)); GPR_ASSERT(!args->is_last); diff --git a/src/core/lib/surface/channel.cc b/src/core/lib/surface/channel.cc index 9d38fe9c71..48bc69509f 100644 --- a/src/core/lib/surface/channel.cc +++ b/src/core/lib/surface/channel.cc @@ -155,13 +155,6 @@ static grpc_core::UniquePtr<char> get_default_authority( if (!has_default_authority && ssl_override != nullptr) { default_authority.reset(gpr_strdup(ssl_override)); } - if (channel_stack_type == GRPC_CLIENT_DIRECT_CHANNEL && - !has_default_authority) { - gpr_log(GPR_ERROR, - "Direct channels must specify a value for the " - "GRPC_ARG_DEFAULT_AUTHORITY channel arg."); - abort(); - } return default_authority; } |