diff options
author | Noah Eisen <ncteisen@gmail.com> | 2018-06-14 11:43:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-14 11:43:18 -0400 |
commit | 7ea8a60ed0ba4faeeb912e9b76ae1d0a222b3ddf (patch) | |
tree | 7a709e76d25faf1532df83c73dcefc571bd5685c /src/core/lib/security/transport | |
parent | 9a2c0a8641d1837185a60436adf9419209f89fbe (diff) |
Revert "Add Type Checking On Channel Args"
Diffstat (limited to 'src/core/lib/security/transport')
-rw-r--r-- | src/core/lib/security/transport/target_authority_table.cc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/core/lib/security/transport/target_authority_table.cc b/src/core/lib/security/transport/target_authority_table.cc index 467e681a50..1eeb557f6a 100644 --- a/src/core/lib/security/transport/target_authority_table.cc +++ b/src/core/lib/security/transport/target_authority_table.cc @@ -59,8 +59,17 @@ grpc_arg CreateTargetAuthorityTableChannelArg(TargetAuthorityTable* table) { TargetAuthorityTable* FindTargetAuthorityTableInArgs( const grpc_channel_args* args) { - return grpc_channel_args_get_pointer<TargetAuthorityTable>( - args, GRPC_ARG_TARGET_AUTHORITY_TABLE); + const grpc_arg* arg = + grpc_channel_args_find(args, GRPC_ARG_TARGET_AUTHORITY_TABLE); + if (arg != nullptr) { + if (arg->type == GRPC_ARG_POINTER) { + return static_cast<TargetAuthorityTable*>(arg->value.pointer.p); + } else { + gpr_log(GPR_ERROR, "value of " GRPC_ARG_TARGET_AUTHORITY_TABLE + " channel arg was not pointer type; ignoring"); + } + } + return nullptr; } } // namespace grpc_core |