|
|
|
@ -205,11 +205,13 @@ grpc_channel* grpc_secure_channel_create(grpc_channel_credentials* creds, |
|
|
|
|
// Add channel args containing the client channel factory and channel
|
|
|
|
|
// credentials.
|
|
|
|
|
gpr_once_init(&g_factory_once, FactoryInit); |
|
|
|
|
grpc_arg args_to_add[] = { |
|
|
|
|
grpc_core::ClientChannelFactory::CreateChannelArg(g_factory), |
|
|
|
|
grpc_channel_credentials_to_arg(creds)}; |
|
|
|
|
grpc_channel_args* new_args = grpc_channel_args_copy_and_add( |
|
|
|
|
args, args_to_add, GPR_ARRAY_SIZE(args_to_add)); |
|
|
|
|
grpc_arg channel_factory_arg = |
|
|
|
|
grpc_core::ClientChannelFactory::CreateChannelArg(g_factory); |
|
|
|
|
grpc_arg args_to_add[] = {channel_factory_arg, |
|
|
|
|
grpc_channel_credentials_to_arg(creds)}; |
|
|
|
|
const char* arg_to_remove = channel_factory_arg.key; |
|
|
|
|
grpc_channel_args* new_args = grpc_channel_args_copy_and_add_and_remove( |
|
|
|
|
args, &arg_to_remove, 1, args_to_add, GPR_ARRAY_SIZE(args_to_add)); |
|
|
|
|
new_args = creds->update_arguments(new_args); |
|
|
|
|
// Create channel.
|
|
|
|
|
channel = grpc_core::CreateChannel(target, new_args); |
|
|
|
|