Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 1 | /* |
| 2 | * |
Craig Tiller | 0605995 | 2015-02-18 08:34:56 -0800 | [diff] [blame] | 3 | * Copyright 2015, Google Inc. |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 4 | * All rights reserved. |
| 5 | * |
| 6 | * Redistribution and use in source and binary forms, with or without |
| 7 | * modification, are permitted provided that the following conditions are |
| 8 | * met: |
| 9 | * |
| 10 | * * Redistributions of source code must retain the above copyright |
| 11 | * notice, this list of conditions and the following disclaimer. |
| 12 | * * Redistributions in binary form must reproduce the above |
| 13 | * copyright notice, this list of conditions and the following disclaimer |
| 14 | * in the documentation and/or other materials provided with the |
| 15 | * distribution. |
| 16 | * * Neither the name of Google Inc. nor the names of its |
| 17 | * contributors may be used to endorse or promote products derived from |
| 18 | * this software without specific prior written permission. |
| 19 | * |
| 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 21 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 22 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 23 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 24 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 25 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 27 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 28 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 30 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 31 | * |
| 32 | */ |
| 33 | |
| 34 | #include <grpc/grpc.h> |
| 35 | |
| 36 | #include <stdlib.h> |
| 37 | #include <string.h> |
| 38 | |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 39 | #include <grpc/support/alloc.h> |
| 40 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 41 | #include "src/core/channel/channel_args.h" |
| 42 | #include "src/core/channel/client_channel.h" |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 43 | #include "src/core/channel/http_client_filter.h" |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 44 | #include "src/core/client_config/resolver_registry.h" |
ctiller | 18b49ab | 2014-12-09 14:39:16 -0800 | [diff] [blame] | 45 | #include "src/core/iomgr/tcp_client.h" |
Julien Boeuf | c6f8d0a | 2015-05-11 22:40:02 -0700 | [diff] [blame] | 46 | #include "src/core/security/auth_filters.h" |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 47 | #include "src/core/security/credentials.h" |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 48 | #include "src/core/security/secure_transport_setup.h" |
| 49 | #include "src/core/surface/channel.h" |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 50 | #include "src/core/transport/chttp2_transport.h" |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 51 | #include "src/core/tsi/transport_security_interface.h" |
| 52 | |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 53 | typedef struct { |
| 54 | grpc_connector base; |
| 55 | gpr_refcount refs; |
| 56 | |
| 57 | grpc_channel_security_connector *security_connector; |
| 58 | |
| 59 | grpc_iomgr_closure *notify; |
| 60 | grpc_connect_in_args args; |
| 61 | grpc_connect_out_args *result; |
| 62 | } connector; |
| 63 | |
| 64 | static void connector_ref(grpc_connector *con) { |
| 65 | connector *c = (connector *)con; |
| 66 | gpr_ref(&c->refs); |
| 67 | } |
| 68 | |
| 69 | static void connector_unref(grpc_connector *con) { |
| 70 | connector *c = (connector *)con; |
| 71 | if (gpr_unref(&c->refs)) { |
| 72 | gpr_free(c); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | static void on_secure_transport_setup_done(void *arg, |
| 77 | grpc_security_status status, |
| 78 | grpc_endpoint *secure_endpoint) { |
| 79 | connector *c = arg; |
| 80 | grpc_iomgr_closure *notify; |
| 81 | if (status != GRPC_SECURITY_OK) { |
| 82 | gpr_log(GPR_ERROR, "Secure transport setup failed with error %d.", status); |
| 83 | memset(c->result, 0, sizeof(*c->result)); |
| 84 | notify = c->notify; |
| 85 | c->notify = NULL; |
| 86 | grpc_iomgr_add_callback(notify); |
| 87 | } else { |
| 88 | c->result->transport = grpc_create_chttp2_transport( |
| 89 | c->args.channel_args, secure_endpoint, |
| 90 | NULL, 0, c->args.metadata_context, 1); |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | static void connected(void *arg, grpc_endpoint *tcp) { |
| 95 | connector *c = arg; |
| 96 | grpc_iomgr_closure *notify; |
| 97 | if (tcp != NULL) { |
| 98 | grpc_setup_secure_transport(&c->security_connector->base, tcp, |
| 99 | on_secure_transport_setup_done, c); |
| 100 | } else { |
| 101 | memset(c->result, 0, sizeof(*c->result)); |
| 102 | notify = c->notify; |
| 103 | c->notify = NULL; |
| 104 | grpc_iomgr_add_callback(notify); |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | static void connector_connect( |
| 109 | grpc_connector *con, const grpc_connect_in_args *args, |
| 110 | grpc_connect_out_args *result, grpc_iomgr_closure *notify) { |
| 111 | connector *c = (connector *)con; |
| 112 | GPR_ASSERT(c->notify == NULL); |
| 113 | GPR_ASSERT(notify->cb); |
| 114 | c->notify = notify; |
| 115 | c->args = *args; |
| 116 | c->result = result; |
| 117 | grpc_tcp_client_connect(connected, c, args->interested_parties, args->addr, args->addr_len, args->deadline); |
| 118 | } |
| 119 | |
| 120 | static const grpc_connector_vtable connector_vtable = {connector_ref, connector_unref, connector_connect}; |
| 121 | |
| 122 | typedef struct { |
| 123 | grpc_subchannel_factory base; |
| 124 | gpr_refcount refs; |
| 125 | grpc_mdctx *mdctx; |
| 126 | grpc_channel_security_connector *security_connector; |
| 127 | } subchannel_factory; |
| 128 | |
| 129 | static void subchannel_factory_ref(grpc_subchannel_factory *scf) { |
| 130 | subchannel_factory *f = (subchannel_factory *)scf; |
| 131 | gpr_ref(&f->refs); |
| 132 | } |
| 133 | |
| 134 | static void subchannel_factory_unref(grpc_subchannel_factory *scf) { |
| 135 | subchannel_factory *f = (subchannel_factory *)scf; |
| 136 | if (gpr_unref(&f->refs)) { |
| 137 | grpc_mdctx_unref(f->mdctx); |
| 138 | gpr_free(f); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | static grpc_subchannel *subchannel_factory_create_subchannel(grpc_subchannel_factory *scf, grpc_subchannel_args *args) { |
| 143 | subchannel_factory *f = (subchannel_factory *)scf; |
| 144 | connector *c = gpr_malloc(sizeof(*c)); |
| 145 | grpc_subchannel *s; |
| 146 | memset(c, 0, sizeof(*c)); |
| 147 | c->base.vtable = &connector_vtable; |
| 148 | c->security_connector = f->security_connector; |
| 149 | gpr_ref_init(&c->refs, 1); |
| 150 | args->mdctx = f->mdctx; |
| 151 | s = grpc_subchannel_create(&c->base, args); |
| 152 | grpc_connector_unref(&c->base); |
| 153 | return s; |
| 154 | } |
| 155 | |
| 156 | static const grpc_subchannel_factory_vtable subchannel_factory_vtable = {subchannel_factory_ref, subchannel_factory_unref, subchannel_factory_create_subchannel}; |
| 157 | |
| 158 | #if 0 |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 159 | typedef struct setup setup; |
| 160 | |
| 161 | /* A single setup request (started via initiate) */ |
| 162 | typedef struct { |
| 163 | grpc_client_setup_request *cs_request; |
| 164 | setup *setup; |
| 165 | /* Resolved addresses, or null if resolution not yet completed. */ |
| 166 | grpc_resolved_addresses *resolved; |
| 167 | /* which address in resolved should we pick for the next connection attempt */ |
| 168 | size_t resolved_index; |
| 169 | } request; |
| 170 | |
| 171 | struct setup { |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 172 | grpc_channel_security_connector *security_connector; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 173 | const char *target; |
| 174 | grpc_transport_setup_callback setup_callback; |
| 175 | void *setup_user_data; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 176 | }; |
| 177 | |
| 178 | static int maybe_try_next_resolved(request *r); |
| 179 | |
| 180 | static void done(request *r, int was_successful) { |
| 181 | grpc_client_setup_request_finish(r->cs_request, was_successful); |
| 182 | if (r->resolved) { |
| 183 | grpc_resolved_addresses_destroy(r->resolved); |
| 184 | } |
| 185 | gpr_free(r); |
| 186 | } |
| 187 | |
| 188 | static void on_secure_transport_setup_done(void *rp, |
| 189 | grpc_security_status status, |
| 190 | grpc_endpoint *secure_endpoint) { |
| 191 | request *r = rp; |
| 192 | if (status != GRPC_SECURITY_OK) { |
| 193 | gpr_log(GPR_ERROR, "Secure transport setup failed with error %d.", status); |
| 194 | done(r, 0); |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 195 | } else if (grpc_client_setup_cb_begin(r->cs_request, |
| 196 | "on_secure_transport_setup_done")) { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 197 | grpc_create_chttp2_transport( |
| 198 | r->setup->setup_callback, r->setup->setup_user_data, |
| 199 | grpc_client_setup_get_channel_args(r->cs_request), secure_endpoint, |
| 200 | NULL, 0, grpc_client_setup_get_mdctx(r->cs_request), 1); |
Craig Tiller | cb36e9f | 2015-05-29 11:20:21 -0700 | [diff] [blame] | 201 | grpc_client_setup_cb_end(r->cs_request, "on_secure_transport_setup_done"); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 202 | done(r, 1); |
Craig Tiller | 43a2b17 | 2015-02-18 17:17:51 -0800 | [diff] [blame] | 203 | } else { |
| 204 | done(r, 0); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 205 | } |
| 206 | } |
| 207 | |
| 208 | /* connection callback: tcp is either valid, or null on error */ |
| 209 | static void on_connect(void *rp, grpc_endpoint *tcp) { |
| 210 | request *r = rp; |
| 211 | |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 212 | if (!grpc_client_setup_request_should_continue(r->cs_request, |
| 213 | "on_connect.secure")) { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 214 | if (tcp) { |
| 215 | grpc_endpoint_shutdown(tcp); |
| 216 | grpc_endpoint_destroy(tcp); |
| 217 | } |
| 218 | done(r, 0); |
| 219 | return; |
| 220 | } |
| 221 | |
| 222 | if (!tcp) { |
| 223 | if (!maybe_try_next_resolved(r)) { |
| 224 | done(r, 0); |
| 225 | return; |
| 226 | } else { |
| 227 | return; |
| 228 | } |
| 229 | } else { |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 230 | grpc_setup_secure_transport(&r->setup->security_connector->base, tcp, |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 231 | on_secure_transport_setup_done, r); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | /* attempt to connect to the next available resolved address */ |
| 236 | static int maybe_try_next_resolved(request *r) { |
| 237 | grpc_resolved_address *addr; |
| 238 | if (!r->resolved) return 0; |
| 239 | if (r->resolved_index == r->resolved->naddrs) return 0; |
| 240 | addr = &r->resolved->addrs[r->resolved_index++]; |
Craig Tiller | 8ed24e2 | 2015-05-08 09:59:51 -0700 | [diff] [blame] | 241 | grpc_tcp_client_connect( |
| 242 | on_connect, r, grpc_client_setup_get_interested_parties(r->cs_request), |
| 243 | (struct sockaddr *)&addr->addr, addr->len, |
| 244 | grpc_client_setup_request_deadline(r->cs_request)); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 245 | return 1; |
| 246 | } |
| 247 | |
| 248 | /* callback for when our target address has been resolved */ |
| 249 | static void on_resolved(void *rp, grpc_resolved_addresses *resolved) { |
| 250 | request *r = rp; |
| 251 | |
| 252 | /* if we're not still the active request, abort */ |
Craig Tiller | 8674cb1 | 2015-06-05 07:09:25 -0700 | [diff] [blame] | 253 | if (!grpc_client_setup_request_should_continue(r->cs_request, |
| 254 | "on_resolved.secure")) { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 255 | if (resolved) { |
| 256 | grpc_resolved_addresses_destroy(resolved); |
| 257 | } |
| 258 | done(r, 0); |
| 259 | return; |
| 260 | } |
| 261 | |
| 262 | if (!resolved) { |
| 263 | done(r, 0); |
| 264 | return; |
| 265 | } else { |
| 266 | r->resolved = resolved; |
| 267 | r->resolved_index = 0; |
| 268 | if (!maybe_try_next_resolved(r)) { |
| 269 | done(r, 0); |
| 270 | } |
| 271 | } |
| 272 | } |
| 273 | |
| 274 | static void initiate_setup(void *sp, grpc_client_setup_request *cs_request) { |
| 275 | request *r = gpr_malloc(sizeof(request)); |
| 276 | r->setup = sp; |
| 277 | r->cs_request = cs_request; |
| 278 | r->resolved = NULL; |
| 279 | r->resolved_index = 0; |
| 280 | /* TODO(klempner): Make grpc_resolve_address respect deadline */ |
| 281 | grpc_resolve_address(r->setup->target, "https", on_resolved, r); |
| 282 | } |
| 283 | |
| 284 | static void done_setup(void *sp) { |
| 285 | setup *s = sp; |
| 286 | gpr_free((void *)s->target); |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 287 | grpc_security_connector_unref(&s->security_connector->base); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 288 | gpr_free(s); |
| 289 | } |
| 290 | |
| 291 | static grpc_transport_setup_result complete_setup(void *channel_stack, |
| 292 | grpc_transport *transport, |
| 293 | grpc_mdctx *mdctx) { |
Julien Boeuf | 54b2192 | 2015-02-04 16:39:35 -0800 | [diff] [blame] | 294 | static grpc_channel_filter const *extra_filters[] = { |
Craig Tiller | 6e84aba | 2015-04-23 15:08:17 -0700 | [diff] [blame] | 295 | &grpc_client_auth_filter, &grpc_http_client_filter}; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 296 | return grpc_client_channel_transport_setup_complete( |
| 297 | channel_stack, transport, extra_filters, GPR_ARRAY_SIZE(extra_filters), |
| 298 | mdctx); |
| 299 | } |
| 300 | |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 301 | #endif |
| 302 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 303 | /* Create a secure client channel: |
| 304 | Asynchronously: - resolve target |
| 305 | - connect to it (trying alternatives as presented) |
| 306 | - perform handshakes */ |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 307 | grpc_channel *grpc_secure_channel_create(grpc_credentials *creds, |
| 308 | const char *target, |
| 309 | const grpc_channel_args *args) { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 310 | grpc_channel *channel; |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 311 | grpc_arg connector_arg; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 312 | grpc_channel_args *args_copy; |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 313 | grpc_channel_args *new_args_from_connector; |
Craig Tiller | 1a727fd | 2015-04-24 13:21:22 -0700 | [diff] [blame] | 314 | grpc_channel_security_connector *connector; |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 315 | grpc_mdctx *mdctx; |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 316 | grpc_resolver *resolver; |
| 317 | subchannel_factory *f; |
Julien Boeuf | 54b2192 | 2015-02-04 16:39:35 -0800 | [diff] [blame] | 318 | #define MAX_FILTERS 3 |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 319 | const grpc_channel_filter *filters[MAX_FILTERS]; |
| 320 | int n = 0; |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 321 | |
| 322 | if (grpc_find_security_connector_in_args(args) != NULL) { |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 323 | gpr_log(GPR_ERROR, "Cannot set security context in channel args."); |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 324 | return grpc_lame_client_channel_create(); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 325 | } |
| 326 | |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 327 | if (grpc_credentials_create_security_connector( |
| 328 | creds, target, args, NULL, &connector, &new_args_from_connector) != |
| 329 | GRPC_SECURITY_OK) { |
| 330 | return grpc_lame_client_channel_create(); |
| 331 | } |
Julien Boeuf | 75c9b6f | 2015-05-29 13:12:12 -0700 | [diff] [blame] | 332 | mdctx = grpc_mdctx_create(); |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 333 | |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 334 | connector_arg = grpc_security_connector_to_arg(&connector->base); |
| 335 | args_copy = grpc_channel_args_copy_and_add( |
| 336 | new_args_from_connector != NULL ? new_args_from_connector : args, |
| 337 | &connector_arg); |
Alistair Veitch | 9686dab | 2015-05-26 14:26:47 -0700 | [diff] [blame] | 338 | /* TODO(census) |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 339 | if (grpc_channel_args_is_census_enabled(args)) { |
| 340 | filters[n++] = &grpc_client_census_filter; |
Alistair Veitch | 9686dab | 2015-05-26 14:26:47 -0700 | [diff] [blame] | 341 | } */ |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 342 | filters[n++] = &grpc_client_channel_filter; |
| 343 | GPR_ASSERT(n <= MAX_FILTERS); |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 344 | |
| 345 | f = gpr_malloc(sizeof(*f)); |
| 346 | f->base.vtable = &subchannel_factory_vtable; |
| 347 | gpr_ref_init(&f->refs, 1); |
| 348 | f->mdctx = mdctx; |
| 349 | f->security_connector = connector; |
| 350 | resolver = grpc_resolver_create(target, &f->base); |
| 351 | if (!resolver) { |
| 352 | return NULL; |
| 353 | } |
| 354 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 355 | channel = grpc_channel_create_from_filters(filters, n, args_copy, mdctx, 1); |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 356 | grpc_client_channel_set_resolver(grpc_channel_get_channel_stack(channel), resolver); |
| 357 | grpc_resolver_unref(resolver); |
| 358 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 359 | grpc_channel_args_destroy(args_copy); |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 360 | if (new_args_from_connector != NULL) { |
| 361 | grpc_channel_args_destroy(new_args_from_connector); |
| 362 | } |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 363 | |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 364 | #if 0 |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 365 | s->target = gpr_strdup(target); |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 366 | s->setup_callback = complete_setup; |
| 367 | s->setup_user_data = grpc_channel_get_channel_stack(channel); |
Julien Boeuf | 7d1d9ca | 2015-04-17 14:38:48 -0700 | [diff] [blame] | 368 | s->security_connector = connector; |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 369 | grpc_client_setup_create_and_attach(grpc_channel_get_channel_stack(channel), |
| 370 | args, mdctx, initiate_setup, done_setup, |
ctiller | 18b49ab | 2014-12-09 14:39:16 -0800 | [diff] [blame] | 371 | s); |
Craig Tiller | acf0f07 | 2015-06-29 08:24:16 -0700 | [diff] [blame^] | 372 | #endif |
| 373 | |
Nicolas Noble | b7ebd3b | 2014-11-26 16:33:03 -0800 | [diff] [blame] | 374 | return channel; |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 375 | } |