diff options
author | 2015-12-17 16:00:51 -0800 | |
---|---|---|
committer | 2015-12-28 10:48:15 -0800 | |
commit | 05a8341cf11105775cd8fa90a7705d5cde346a61 (patch) | |
tree | 8aff3d304c6577434fe76abab10897b8fb51f058 /src/core/surface | |
parent | 9a79e28c4e2dca4c32e46c6e4a867a196e7a1bb3 (diff) |
Making the stack work with outgoing channel args.
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/channel_create.c | 1 | ||||
-rw-r--r-- | src/core/surface/secure_channel_create.c | 18 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 97ec23408f..49083f0870 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -104,6 +104,7 @@ static void connected(grpc_exec_ctx *exec_ctx, void *arg, int success) { grpc_chttp2_transport_start_reading(exec_ctx, c->result->transport, NULL, 0); GPR_ASSERT(c->result->transport); + c->result->channel_args = c->args.channel_args; c->result->filters = gpr_malloc(sizeof(grpc_channel_filter *)); c->result->filters[0] = &grpc_http_client_filter; c->result->num_filters = 1; diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 8ff3c78681..552a570713 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -93,6 +93,7 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_auth_context *auth_context) { connector *c = arg; grpc_closure *notify; + grpc_channel_args *args_copy = NULL; gpr_mu_lock(&c->mu); if (c->connecting_endpoint == NULL) { memset(c->result, 0, sizeof(*c->result)); @@ -103,18 +104,17 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, c->connecting_endpoint = NULL; gpr_mu_unlock(&c->mu); } else { + grpc_arg auth_context_arg; c->connecting_endpoint = NULL; gpr_mu_unlock(&c->mu); - { - grpc_arg auth_context_arg = grpc_auth_context_to_arg(auth_context); - grpc_channel_args *args_copy = grpc_channel_args_copy_and_add( - c->args.channel_args, &auth_context_arg, 1); - c->result->transport = grpc_create_chttp2_transport( - exec_ctx, args_copy, secure_endpoint, 1); - grpc_channel_args_destroy(args_copy); - } + c->result->transport = grpc_create_chttp2_transport( + exec_ctx, c->args.channel_args, secure_endpoint, 1); grpc_chttp2_transport_start_reading(exec_ctx, c->result->transport, NULL, 0); + auth_context_arg = grpc_auth_context_to_arg(auth_context); + args_copy = grpc_channel_args_copy_and_add(c->args.channel_args, + &auth_context_arg, 1); + c->result->channel_args = args_copy; c->result->filters = gpr_malloc(sizeof(grpc_channel_filter *) * 2); c->result->filters[0] = &grpc_http_client_filter; c->result->filters[1] = &grpc_client_auth_filter; @@ -122,7 +122,9 @@ static void on_secure_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, } notify = c->notify; c->notify = NULL; + /* look at c->args which are connector args. */ notify->cb(exec_ctx, notify->cb_arg, 1); + if (args_copy != NULL) grpc_channel_args_destroy(args_copy); } static void on_initial_connect_string_sent(grpc_exec_ctx *exec_ctx, void *arg, |