diff options
author | Mark D. Roth <roth@google.com> | 2017-01-18 07:23:36 -0800 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2017-01-18 07:23:36 -0800 |
commit | 37225c450da3c56d36b5333203a159b2f88d3bf1 (patch) | |
tree | 93b3fb8b2f068e672e583234bca169854711c6d8 /src/core/ext/resolver | |
parent | c0d7d67dfbe4f7d539e64365c4111b748285668f (diff) |
Trigger HTTP CONNECT handshaker via channel arg.
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 655d9dc586..aaf52dc430 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -261,10 +261,16 @@ static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx, return NULL; } // Get name from args. - const char *path = args->uri->path; + char *path = args->uri->path; if (path[0] == '/') ++path; // Get proxy name, if any. char *proxy_name = grpc_get_http_proxy_server(); + grpc_arg new_arg; + if (proxy_name != NULL) { + new_arg.key = GRPC_ARG_HTTP_CONNECT_SERVER; + new_arg.type = GRPC_ARG_STRING; + new_arg.value.string = path; + } // Create resolver. dns_resolver *r = gpr_malloc(sizeof(dns_resolver)); memset(r, 0, sizeof(*r)); @@ -272,7 +278,9 @@ static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx, grpc_resolver_init(&r->base, &dns_resolver_vtable); r->name_to_resolve = proxy_name == NULL ? gpr_strdup(path) : proxy_name; r->default_port = gpr_strdup(default_port); - r->channel_args = grpc_channel_args_copy(args->args); + r->channel_args = proxy_name == NULL + ? grpc_channel_args_copy(args->args) + : grpc_channel_args_copy_and_add(args->args, &new_arg, 1); r->interested_parties = grpc_pollset_set_create(); if (args->pollset_set != NULL) { grpc_pollset_set_add_pollset_set(exec_ctx, r->interested_parties, |