aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-08-17 11:15:19 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-08-17 11:15:19 -0700
commit67b5d4bbcca558150183c28b5f9d8feca2f5fc0f (patch)
tree7662b3a3870b547e4ff22aab77a786ae4f8927c9 /src
parentdd93704056742921220ba4dc1f8d9b288398ed1f (diff)
Plumb server name through grpclb LB policy.
Diffstat (limited to 'src')
-rw-r--r--src/core/ext/lb_policy/grpclb/grpclb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/ext/lb_policy/grpclb/grpclb.c b/src/core/ext/lb_policy/grpclb/grpclb.c
index af913d8a9d..c595d95566 100644
--- a/src/core/ext/lb_policy/grpclb/grpclb.c
+++ b/src/core/ext/lb_policy/grpclb/grpclb.c
@@ -235,6 +235,7 @@ typedef struct glb_lb_policy {
/** mutex protecting remaining members */
gpr_mu mu;
+ char *server_name; // Does not own.
grpc_client_channel_factory *cc_factory;
/** for communicating with the LB server */
@@ -295,6 +296,7 @@ static grpc_lb_policy *create_rr(grpc_exec_ctx *exec_ctx,
(const char **)host_ports, serverlist->num_servers, ",", &uri_path_len);
grpc_lb_policy_args args;
+ args.server_name = glb_policy->server_name;
args.client_channel_factory = glb_policy->cc_factory;
args.addresses = gpr_malloc(sizeof(grpc_resolved_addresses));
args.addresses->naddrs = serverlist->num_servers;
@@ -422,6 +424,7 @@ static grpc_lb_policy *glb_create(grpc_exec_ctx *exec_ctx,
* policy is only instantiated and used in that case.
*
* Create a client channel over them to communicate with a LB service */
+ glb_policy->server_name = args->server_name;
glb_policy->cc_factory = args->client_channel_factory;
GPR_ASSERT(glb_policy->cc_factory != NULL);
if (args->addresses->naddrs == 0) {