aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/client_config/subchannel.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-11-25 15:32:59 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-11-25 15:32:59 -0800
commitde83121308bfa816dd9c093a5d316af2ac46f422 (patch)
tree20ba34affbfc460249e104bf3e6370c9f00e9046 /src/core/client_config/subchannel.c
parent6d3b229209a12437b7abf813b5dc74b64dc55876 (diff)
parent945836eade7d8f12f6eb84bc209da13ae7c89b38 (diff)
Merge github.com:grpc/grpc into no-transport-metadata
Diffstat (limited to 'src/core/client_config/subchannel.c')
-rw-r--r--src/core/client_config/subchannel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c
index 8e19701997..28496ac2c9 100644
--- a/src/core/client_config/subchannel.c
+++ b/src/core/client_config/subchannel.c
@@ -40,6 +40,7 @@
#include "src/core/channel/channel_args.h"
#include "src/core/channel/client_channel.h"
#include "src/core/channel/connected_channel.h"
+#include "src/core/client_config/initial_connect_string.h"
#include "src/core/iomgr/timer.h"
#include "src/core/profiling/timers.h"
#include "src/core/surface/channel.h"
@@ -87,6 +88,8 @@ struct grpc_subchannel {
/** address to connect to */
struct sockaddr *addr;
size_t addr_len;
+ /** initial string to send to peer */
+ gpr_slice initial_connect_string;
/** master channel - the grpc_channel instance that ultimately owns
this channel_data via its channel stack.
We occasionally use this to bump the refcount on the master channel
@@ -265,6 +268,7 @@ static void subchannel_destroy(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
gpr_free((void *)c->filters);
grpc_channel_args_destroy(c->args);
gpr_free(c->addr);
+ gpr_slice_unref(c->initial_connect_string);
grpc_connectivity_state_destroy(exec_ctx, &c->state_tracker);
grpc_connector_unref(exec_ctx, c->connector);
gpr_free(c);
@@ -302,6 +306,8 @@ grpc_subchannel *grpc_subchannel_create(grpc_connector *connector,
c->addr = gpr_malloc(args->addr_len);
memcpy(c->addr, args->addr, args->addr_len);
c->addr_len = args->addr_len;
+ grpc_set_initial_connect_string(&c->addr, &c->addr_len,
+ &c->initial_connect_string);
c->args = grpc_channel_args_copy(args->args);
c->master = args->master;
c->pollset_set = grpc_client_channel_get_connecting_pollset_set(parent_elem);
@@ -375,6 +381,7 @@ static void continue_connect(grpc_exec_ctx *exec_ctx, grpc_subchannel *c) {
args.addr_len = c->addr_len;
args.deadline = compute_connect_deadline(c);
args.channel_args = c->args;
+ args.initial_connect_string = c->initial_connect_string;
grpc_connector_connect(exec_ctx, c->connector, &args, &c->connecting_result,
&c->connected);