diff options
author | Mark D. Roth <roth@google.com> | 2016-09-16 08:51:01 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-09-16 08:51:01 -0700 |
commit | c5c38782ecc885c372b4337f69c6d27a5c51dd42 (patch) | |
tree | 693406a1020ba941ef91eadf8f1b16bb3a77cc5a /src/core/ext/resolver | |
parent | 46131d849efa3fabace12e1dcd2c17d9f1fee35e (diff) | |
parent | d2f7268bc702d0bf2083b9dedb2ec07544b83dd2 (diff) |
Merge remote-tracking branch 'upstream/master' into grpclb_resolver_changes
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 10 | ||||
-rw-r--r-- | src/core/ext/resolver/sockaddr/sockaddr_resolver.c | 9 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 8fc10d98a8..63682db7de 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -173,17 +173,19 @@ static void dns_on_resolved(grpc_exec_ctx *exec_ctx, void *arg, if (r->addresses != NULL) { grpc_lb_policy_args lb_policy_args; memset(&lb_policy_args, 0, sizeof(lb_policy_args)); - lb_policy_args.addresses = grpc_addresses_create(r->addresses->naddrs); + lb_policy_args.addresses = grpc_lb_addresses_create(r->addresses->naddrs); for (size_t i = 0; i < r->addresses->naddrs; ++i) { - grpc_addresses_set_address( + grpc_lb_addresses_set_address( lb_policy_args.addresses, i, &r->addresses->addrs[i].addr, - r->addresses->addrs[i].len, false /* is_balancer */); + r->addresses->addrs[i].len, false /* is_balancer */, + NULL /* balancer_name */, NULL /* user_data */); } grpc_resolved_addresses_destroy(r->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); - grpc_addresses_destroy(lb_policy_args.addresses); + grpc_lb_addresses_destroy(lb_policy_args.addresses, + NULL /* user_data_destroy */); result = grpc_resolver_result_create(); if (lb_policy != NULL) { grpc_resolver_result_set_lb_policy(result, lb_policy); diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index 94d2f892eb..307e0698f9 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -58,7 +58,7 @@ typedef struct { char *lb_policy_name; /** the addresses that we've 'resolved' */ - grpc_addresses *addresses; + grpc_lb_addresses *addresses; /** mutex guarding the rest of the state */ gpr_mu mu; @@ -129,6 +129,7 @@ static void sockaddr_maybe_finish_next_locked(grpc_exec_ctx *exec_ctx, lb_policy_args.client_channel_factory = r->client_channel_factory; grpc_lb_policy *lb_policy = grpc_lb_policy_create(exec_ctx, r->lb_policy_name, &lb_policy_args); + gpr_free(lb_policy_args.addresses); grpc_resolver_result_set_lb_policy(result, lb_policy); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "sockaddr"); r->published = true; @@ -142,7 +143,7 @@ static void sockaddr_destroy(grpc_exec_ctx *exec_ctx, grpc_resolver *gr) { sockaddr_resolver *r = (sockaddr_resolver *)gr; gpr_mu_destroy(&r->mu); grpc_client_channel_factory_unref(exec_ctx, r->client_channel_factory); - grpc_addresses_destroy(r->addresses); + grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); gpr_free(r->lb_policy_name); gpr_free(r); } @@ -216,7 +217,7 @@ static grpc_resolver *sockaddr_create( gpr_slice_buffer_init(&path_parts); gpr_slice_split(path_slice, ",", &path_parts); - r->addresses = grpc_addresses_create(path_parts.count); + r->addresses = grpc_lb_addresses_create(path_parts.count); for (size_t i = 0; i < r->addresses->num_addresses; i++) { grpc_uri ith_uri = *args->uri; char *part_str = gpr_dump_slice(path_parts.slices[i], GPR_DUMP_ASCII); @@ -235,7 +236,7 @@ static grpc_resolver *sockaddr_create( gpr_slice_unref(path_slice); if (errors_found) { gpr_free(r->lb_policy_name); - grpc_addresses_destroy(r->addresses); + grpc_lb_addresses_destroy(r->addresses, NULL /* user_data_destroy */); gpr_free(r); return NULL; } |