Fix link problem for insecure target.

pull/8913/head
Mark D. Roth 8 years ago
parent b62f364d0a
commit e6e1c9e7a1
  1. 10
      src/core/ext/transport/chttp2/client/chttp2_connector.c
  2. 8
      src/core/ext/transport/chttp2/client/chttp2_connector.h
  3. 3
      src/core/ext/transport/chttp2/client/insecure/channel_create.c
  4. 9
      src/core/ext/transport/chttp2/client/secure/secure_channel_create.c

@ -222,7 +222,9 @@ static const grpc_connector_vtable chttp2_connector_vtable = {
grpc_connector *grpc_chttp2_connector_create(
grpc_exec_ctx *exec_ctx, const char* server_name,
grpc_channel_security_connector* security_connector) {
void (*create_handshakers)(grpc_exec_ctx* exec_ctx, void* user_data,
grpc_handshake_manager* handshake_mgr),
void* user_data) {
chttp2_connector *c = gpr_malloc(sizeof(*c));
memset(c, 0, sizeof(*c));
c->base.vtable = &chttp2_connector_vtable;
@ -236,10 +238,8 @@ grpc_connector *grpc_chttp2_connector_create(
grpc_http_connect_handshaker_create(proxy_name, server_name));
gpr_free(proxy_name);
}
if (security_connector != NULL) {
// FIXME: this function call is not linked in for the insecure target!
grpc_channel_security_connector_create_handshakers(
exec_ctx, security_connector, c->handshake_mgr);
if (create_handshakers != NULL) {
create_handshakers(exec_ctx, user_data, c->handshake_mgr);
}
return &c->base;
}

@ -35,10 +35,14 @@
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/security/transport/security_connector.h"
#include "src/core/lib/channel/handshaker.h"
/// If \a create_handshakers is non-NULL, it will be called with
/// \a user_data to add handshakers.
grpc_connector *grpc_chttp2_connector_create(
grpc_exec_ctx *exec_ctx, const char* server_name,
grpc_channel_security_connector* security_connector);
void (*create_handshakers)(grpc_exec_ctx* exec_ctx, void* user_data,
grpc_handshake_manager* handshake_mgr),
void* user_data);
#endif /* GRPC_CORE_EXT_TRANSPORT_CHTTP2_CLIENT_CHTTP2_CONNECTOR_H */

@ -53,7 +53,8 @@ static grpc_subchannel *client_channel_factory_create_subchannel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const grpc_subchannel_args *args) {
grpc_connector *connector = grpc_chttp2_connector_create(
exec_ctx, args->server_name, NULL /* security_connector */);
exec_ctx, args->server_name, NULL /* create_handshakers */,
NULL /* user_data */);
grpc_subchannel *s = grpc_subchannel_create(exec_ctx, connector, args);
grpc_connector_unref(exec_ctx, connector);
return s;

@ -68,13 +68,20 @@ static void client_channel_factory_unref(
}
}
static void create_handshakers(grpc_exec_ctx* exec_ctx,
void* security_connector,
grpc_handshake_manager* handshake_mgr) {
grpc_channel_security_connector_create_handshakers(
exec_ctx, security_connector, handshake_mgr);
}
static grpc_subchannel *client_channel_factory_create_subchannel(
grpc_exec_ctx *exec_ctx, grpc_client_channel_factory *cc_factory,
const grpc_subchannel_args *args) {
client_channel_factory *f = (client_channel_factory *)cc_factory;
grpc_connector *connector =
grpc_chttp2_connector_create(exec_ctx, args->server_name,
f->security_connector);
create_handshakers, f->security_connector);
grpc_subchannel *s = grpc_subchannel_create(exec_ctx, connector, args);
grpc_connector_unref(exec_ctx, connector);
return s;

Loading…
Cancel
Save