aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2016-07-25 11:06:22 -0700
committerGravatar Mark D. Roth <roth@google.com>2016-07-25 11:06:22 -0700
commit28ea7e26309b277f9ba9a7578388b7996f5acbec (patch)
tree5c35d1c8b05dae7ae9718cf1286392aa6e4f6061 /src/core/ext/transport/chttp2
parente273b033da3f374fe82db0644d9455f890bbb296 (diff)
Use URI query string instead of channel arg to indicate use of proxy.
Diffstat (limited to 'src/core/ext/transport/chttp2')
-rw-r--r--src/core/ext/transport/chttp2/client/insecure/channel_create.c11
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.c11
2 files changed, 14 insertions, 8 deletions
diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
index 2df4ce1dda..8f8da7f5ea 100644
--- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c
+++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c
@@ -155,6 +155,7 @@ typedef struct {
gpr_refcount refs;
grpc_channel_args *merge_args;
grpc_channel *master;
+ char *http_proxy;
} client_channel_factory;
static void client_channel_factory_ref(
@@ -172,6 +173,8 @@ static void client_channel_factory_unref(
"client_channel_factory");
}
grpc_channel_args_destroy(f->merge_args);
+ if (f->http_proxy != NULL)
+ gpr_free(f->http_proxy);
gpr_free(f);
}
}
@@ -188,10 +191,9 @@ static grpc_subchannel *client_channel_factory_create_subchannel(
c->base.vtable = &connector_vtable;
gpr_ref_init(&c->refs, 1);
c->handshake_mgr = grpc_handshake_manager_create();
- char *proxy_server = grpc_get_http_connect_proxy_server_from_args(final_args);
- if (proxy_server != NULL) {
+ if (f->http_proxy != NULL) {
grpc_handshake_manager_add(
- grpc_http_connect_handshaker_create(proxy_server, args->server_name),
+ grpc_http_connect_handshaker_create(f->http_proxy, args->server_name),
c->handshake_mgr);
}
args->args = final_args;
@@ -210,7 +212,8 @@ static grpc_channel *client_channel_factory_create_channel(
grpc_channel *channel = grpc_channel_create(exec_ctx, target, final_args,
GRPC_CLIENT_CHANNEL, NULL);
grpc_channel_args_destroy(final_args);
- grpc_resolver *resolver = grpc_resolver_create(target, &f->base);
+ grpc_resolver *resolver = grpc_resolver_create(target, &f->base,
+ &f->http_proxy);
if (!resolver) {
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel,
"client_channel_factory_create_channel");
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
index ee8f39434b..863051fea4 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c
@@ -222,6 +222,7 @@ typedef struct {
grpc_channel_args *merge_args;
grpc_channel_security_connector *security_connector;
grpc_channel *master;
+ char *http_proxy;
} client_channel_factory;
static void client_channel_factory_ref(
@@ -241,6 +242,8 @@ static void client_channel_factory_unref(
"client_channel_factory");
}
grpc_channel_args_destroy(f->merge_args);
+ if (f->http_proxy != NULL)
+ gpr_free(f->http_proxy);
gpr_free(f);
}
}
@@ -257,10 +260,9 @@ static grpc_subchannel *client_channel_factory_create_subchannel(
c->base.vtable = &connector_vtable;
c->security_connector = f->security_connector;
c->handshake_mgr = grpc_handshake_manager_create();
- char *proxy_server = grpc_get_http_connect_proxy_server_from_args(final_args);
- if (proxy_server != NULL) {
+ if (f->http_proxy != NULL) {
grpc_handshake_manager_add(
- grpc_http_connect_handshaker_create(proxy_server, args->server_name),
+ grpc_http_connect_handshaker_create(f->http_proxy, args->server_name),
c->handshake_mgr);
}
gpr_mu_init(&c->mu);
@@ -283,7 +285,8 @@ static grpc_channel *client_channel_factory_create_channel(
GRPC_CLIENT_CHANNEL, NULL);
grpc_channel_args_destroy(final_args);
- grpc_resolver *resolver = grpc_resolver_create(target, &f->base);
+ grpc_resolver *resolver = grpc_resolver_create(target, &f->base,
+ &f->http_proxy);
if (resolver != NULL) {
grpc_client_channel_set_resolver(
exec_ctx, grpc_channel_get_channel_stack(channel), resolver);