|
|
|
@ -162,7 +162,6 @@ 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( |
|
|
|
@ -180,7 +179,6 @@ 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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -197,10 +195,12 @@ 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(); |
|
|
|
|
if (f->http_proxy != NULL) { |
|
|
|
|
char *proxy_name = grpc_get_http_proxy_server(); |
|
|
|
|
if (proxy_name != NULL) { |
|
|
|
|
grpc_handshake_manager_add( |
|
|
|
|
c->handshake_mgr, |
|
|
|
|
grpc_http_connect_handshaker_create(f->http_proxy, args->server_name)); |
|
|
|
|
grpc_http_connect_handshaker_create(proxy_name, args->server_name)); |
|
|
|
|
gpr_free(proxy_name); |
|
|
|
|
} |
|
|
|
|
args->args = final_args; |
|
|
|
|
s = grpc_subchannel_create(exec_ctx, &c->base, args); |
|
|
|
@ -218,8 +218,7 @@ 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, &f->http_proxy); |
|
|
|
|
grpc_resolver *resolver = grpc_resolver_create(target, &f->base); |
|
|
|
|
if (!resolver) { |
|
|
|
|
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, channel, |
|
|
|
|
"client_channel_factory_create_channel"); |
|
|
|
|