aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/filters/client_channel/http_connect_handshaker.cc
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-02-14 13:03:51 -0800
committerGravatar ncteisen <ncteisen@gmail.com>2018-02-14 13:03:51 -0800
commit6f374ea2fef54f0cf12af936bc9a30896830152f (patch)
treece7847e1df8e9ffec5cb47878d88286789386098 /src/core/ext/filters/client_channel/http_connect_handshaker.cc
parent08caf82e8d9ca71dfc5739cf1d893a4daf0b6777 (diff)
Use new helper funciton in one file
Diffstat (limited to 'src/core/ext/filters/client_channel/http_connect_handshaker.cc')
-rw-r--r--src/core/ext/filters/client_channel/http_connect_handshaker.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/ext/filters/client_channel/http_connect_handshaker.cc b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
index c1959bdac6..248a6347d5 100644
--- a/src/core/ext/filters/client_channel/http_connect_handshaker.cc
+++ b/src/core/ext/filters/client_channel/http_connect_handshaker.cc
@@ -254,7 +254,8 @@ static void http_connect_handshaker_do_handshake(
// If not found, invoke on_handshake_done without doing anything.
const grpc_arg* arg =
grpc_channel_args_find(args->args, GRPC_ARG_HTTP_CONNECT_SERVER);
- if (arg == nullptr || arg->type != GRPC_ARG_STRING) {
+ char* server_name = grpc_channel_arg_get_string(arg);
+ if (server_name == nullptr) {
// Set shutdown to true so that subsequent calls to
// http_connect_handshaker_shutdown() do nothing.
gpr_mu_lock(&handshaker->mu);
@@ -263,16 +264,15 @@ static void http_connect_handshaker_do_handshake(
GRPC_CLOSURE_SCHED(on_handshake_done, GRPC_ERROR_NONE);
return;
}
- char* server_name = arg->value.string;
// Get headers from channel args.
arg = grpc_channel_args_find(args->args, GRPC_ARG_HTTP_CONNECT_HEADERS);
+ char* arg_header_string = grpc_channel_arg_get_string(arg);
grpc_http_header* headers = nullptr;
size_t num_headers = 0;
char** header_strings = nullptr;
size_t num_header_strings = 0;
- if (arg != nullptr) {
- GPR_ASSERT(arg->type == GRPC_ARG_STRING);
- gpr_string_split(arg->value.string, "\n", &header_strings,
+ if (arg_header_string != nullptr) {
+ gpr_string_split(arg_header_string, "\n", &header_strings,
&num_header_strings);
headers = static_cast<grpc_http_header*>(
gpr_malloc(sizeof(grpc_http_header) * num_header_strings));