aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2016-04-21 22:58:58 -0700
committerGravatar Craig Tiller <ctiller@google.com>2016-04-21 22:58:58 -0700
commite06a81f877080becddcb07923ee680188d4988f3 (patch)
treed8d2794ce588dc4b6ab4ab5a19fb7e777aa365f0
parent88b9e4803ceb6d434c3b59ed0fe8e87f41681dd2 (diff)
Fixup API changes
-rw-r--r--src/core/ext/resolver/zookeeper/zookeeper_resolver.c2
-rw-r--r--test/core/iomgr/resolve_address_test.c28
2 files changed, 23 insertions, 7 deletions
diff --git a/src/core/ext/resolver/zookeeper/zookeeper_resolver.c b/src/core/ext/resolver/zookeeper/zookeeper_resolver.c
index aa0b4bcede..deb4b9b1ef 100644
--- a/src/core/ext/resolver/zookeeper/zookeeper_resolver.c
+++ b/src/core/ext/resolver/zookeeper/zookeeper_resolver.c
@@ -375,8 +375,10 @@ static void zookeeper_get_node_completion(int rc, const char *value,
r->resolved_addrs->naddrs = 0;
r->resolved_total = 1;
/** Further resolves address by DNS */
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_resolve_address(&exec_ctx, address, NULL, zookeeper_dns_resolved, r);
gpr_free(address);
+ grpc_exec_ctx_finish(&exec_ctx);
return;
}
diff --git a/test/core/iomgr/resolve_address_test.c b/test/core/iomgr/resolve_address_test.c
index a66edc9df2..c3ede1801d 100644
--- a/test/core/iomgr/resolve_address_test.c
+++ b/test/core/iomgr/resolve_address_test.c
@@ -59,28 +59,36 @@ static void must_fail(grpc_exec_ctx *exec_ctx, void *evp,
static void test_localhost(void) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address("localhost:1", NULL, must_succeed, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, "localhost:1", NULL, must_succeed, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address("localhost", "1", must_succeed, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, "localhost", "1", must_succeed, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_missing_default_port(void) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address("localhost", NULL, must_fail, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, "localhost", NULL, must_fail, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
static void test_ipv6_with_port(void) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address("[2001:db8::1]:1", NULL, must_succeed, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, "[2001:db8::1]:1", NULL, must_succeed, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
@@ -92,7 +100,9 @@ static void test_ipv6_without_port(void) {
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address(kCases[i], "80", must_succeed, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, kCases[i], "80", must_succeed, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}
@@ -105,7 +115,9 @@ static void test_invalid_ip_addresses(void) {
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address(kCases[i], NULL, must_fail, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, kCases[i], NULL, must_fail, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}
@@ -118,7 +130,9 @@ static void test_unparseable_hostports(void) {
for (i = 0; i < sizeof(kCases) / sizeof(*kCases); i++) {
gpr_event ev;
gpr_event_init(&ev);
- grpc_resolve_address(kCases[i], "1", must_fail, &ev);
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_resolve_address(&exec_ctx, kCases[i], "1", must_fail, &ev);
+ grpc_exec_ctx_finish(&exec_ctx);
GPR_ASSERT(gpr_event_wait(&ev, test_deadline()));
}
}