aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/resolver
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-07-22 13:24:21 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-07-22 13:24:21 -0700
commite273b033da3f374fe82db0644d9455f890bbb296 (patch)
tree9d343743154a6fa690786384bc07e37cf91d41c6 /src/core/ext/resolver
parent77613b2094fcbf8352ea595f64396006c73835cd (diff)
Plumb server name down into the subchannel.
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r--src/core/ext/resolver/dns/native/dns_resolver.c9
-rw-r--r--src/core/ext/resolver/sockaddr/sockaddr_resolver.c1
2 files changed, 6 insertions, 4 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c
index 31ac968670..255448f427 100644
--- a/src/core/ext/resolver/dns/native/dns_resolver.c
+++ b/src/core/ext/resolver/dns/native/dns_resolver.c
@@ -66,7 +66,7 @@ typedef struct {
/** mutex guarding the rest of the state */
gpr_mu mu;
/** are we currently resolving? */
- int resolving;
+ bool resolving;
/** which version of resolved_config have we published? */
int published_version;
/** which version of resolved_config is current? */
@@ -169,16 +169,17 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg,
grpc_lb_policy *lb_policy;
gpr_mu_lock(&r->mu);
GPR_ASSERT(r->resolving);
- r->resolving = 0;
+ r->resolving = false;
grpc_resolved_addresses *addresses = r->addresses;
if (addresses != NULL) {
grpc_lb_policy_args lb_policy_args;
- config = grpc_client_config_create();
memset(&lb_policy_args, 0, sizeof(lb_policy_args));
+ lb_policy_args.server_name = r->name;
lb_policy_args.addresses = addresses;
lb_policy_args.client_channel_factory = r->client_channel_factory;
lb_policy =
grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args);
+ config = grpc_client_config_create();
if (lb_policy != NULL) {
grpc_client_config_set_lb_policy(config, lb_policy);
GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "construction");
@@ -218,7 +219,7 @@ static void dns_start_resolving_locked(grpc_exec_ctx *exec_ctx,
dns_resolver *r) {
GRPC_RESOLVER_REF(&r->base, "dns-resolving");
GPR_ASSERT(!r->resolving);
- r->resolving = 1;
+ r->resolving = true;
r->addresses = NULL;
grpc_resolve_address(exec_ctx, r->name, r->default_port,
grpc_closure_create(dns_on_resolved, r), &r->addresses);
diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
index 1f7cce2f43..e7c2d5c928 100644
--- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
+++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c
@@ -125,6 +125,7 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx,
grpc_client_config *cfg = grpc_client_config_create();
grpc_lb_policy_args lb_policy_args;
memset(&lb_policy_args, 0, sizeof(lb_policy_args));
+ lb_policy_args.server_name = "";
lb_policy_args.addresses = r->addresses;
lb_policy_args.client_channel_factory = r->client_channel_factory;
grpc_lb_policy *lb_policy =