diff options
author | Mark D. Roth <roth@google.com> | 2016-09-06 12:50:42 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-09-06 12:50:42 -0700 |
commit | 39b5871d7b1da79945c87f98acc4cbbd499ecfba (patch) | |
tree | 69a8bfe3a9e210264ab687376b2032421ff34bf7 /src/core/ext/resolver | |
parent | 6c3295a5a263d853e3ceb163c7b230c2d87374f6 (diff) |
Use http_proxy environment variable instead of URI query param.
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 5f41fdcc2f..5886f6dcbf 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -37,6 +37,7 @@ #include <grpc/support/host_port.h> #include <grpc/support/string_util.h> +#include "src/core/ext/client_config/http_connect_handshaker.h" #include "src/core/ext/client_config/lb_policy_registry.h" #include "src/core/ext/client_config/resolver_registry.h" #include "src/core/lib/iomgr/resolve_address.h" @@ -262,10 +263,11 @@ static grpc_resolver *dns_create(grpc_resolver_args *args, gpr_log(GPR_ERROR, "authority based dns uri's not supported"); return NULL; } - // Get name and (optionally) proxy address from args. + // Get name from args. const char *path = args->uri->path; if (path[0] == '/') ++path; - const char *proxy_name = grpc_uri_get_query_arg(args->uri, "http_proxy"); + // Get proxy name, if any. + char *proxy_name = grpc_get_http_proxy_server(); // Create resolver. dns_resolver *r = gpr_malloc(sizeof(dns_resolver)); memset(r, 0, sizeof(*r)); @@ -273,7 +275,7 @@ static grpc_resolver *dns_create(grpc_resolver_args *args, gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &dns_resolver_vtable); r->target_name = gpr_strdup(path); - r->name_to_resolve = gpr_strdup(proxy_name == NULL ? path : proxy_name); + r->name_to_resolve = proxy_name == NULL ? gpr_strdup(path) : proxy_name; r->default_port = gpr_strdup(default_port); r->client_channel_factory = args->client_channel_factory; gpr_backoff_init(&r->backoff_state, BACKOFF_MULTIPLIER, BACKOFF_JITTER, |