diff options
author | Craig Tiller <ctiller@google.com> | 2015-06-25 13:52:57 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-06-25 13:52:57 -0700 |
commit | 1064f8b97e059e1db3b7d1795748db335909ee42 (patch) | |
tree | 95b26a60fd4cde553760ff8a318a27333807b639 /src/core/surface | |
parent | 13ec8719cacd43972762cc07f3c4befd6f67bc6d (diff) |
Moving chttp2 to new transport interface
Diffstat (limited to 'src/core/surface')
-rw-r--r-- | src/core/surface/server.c | 15 | ||||
-rw-r--r-- | src/core/surface/server.h | 8 | ||||
-rw-r--r-- | src/core/surface/server_chttp2.c | 18 |
3 files changed, 19 insertions, 22 deletions
diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 568f7925dd..98e0e81eaa 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -871,10 +871,10 @@ void grpc_server_start(grpc_server *server) { } } -grpc_transport_setup_result grpc_server_setup_transport( - grpc_server *s, grpc_transport *transport, - grpc_channel_filter const **extra_filters, size_t num_extra_filters, - grpc_mdctx *mdctx, const grpc_channel_args *args) { +void grpc_server_setup_transport(grpc_server *s, grpc_transport *transport, + grpc_channel_filter const **extra_filters, + size_t num_extra_filters, grpc_mdctx *mdctx, + const grpc_channel_args *args) { size_t num_filters = s->channel_filter_count + num_extra_filters + 1; grpc_channel_filter const **filters = gpr_malloc(sizeof(grpc_channel_filter *) * num_filters); @@ -892,7 +892,6 @@ grpc_transport_setup_result grpc_server_setup_transport( gpr_uint32 probes; gpr_uint32 max_probes = 0; grpc_transport_op op; - grpc_transport_setup_result result; for (i = 0; i < s->channel_filter_count; i++) { filters[i] = s->channel_filters[i]; @@ -954,8 +953,8 @@ grpc_transport_setup_result grpc_server_setup_transport( chand->registered_method_max_probes = max_probes; } - result = grpc_connected_channel_bind_transport( - grpc_channel_get_channel_stack(channel), transport); + grpc_connected_channel_bind_transport(grpc_channel_get_channel_stack(channel), + transport); gpr_mu_lock(&s->mu_global); chand->next = &s->root_channel_data; @@ -964,8 +963,6 @@ grpc_transport_setup_result grpc_server_setup_transport( gpr_mu_unlock(&s->mu_global); gpr_free(filters); - - return result; } void grpc_server_shutdown_and_notify(grpc_server *server, diff --git a/src/core/surface/server.h b/src/core/surface/server.h index 91a1a2a7f6..2899c6dea3 100644 --- a/src/core/surface/server.h +++ b/src/core/surface/server.h @@ -55,10 +55,10 @@ void grpc_server_listener_destroy_done(void *server); /* Setup a transport - creates a channel stack, binds the transport to the server */ -grpc_transport_setup_result grpc_server_setup_transport( - grpc_server *server, grpc_transport *transport, - grpc_channel_filter const **extra_filters, size_t num_extra_filters, - grpc_mdctx *mdctx, const grpc_channel_args *args); +void grpc_server_setup_transport(grpc_server *server, grpc_transport *transport, + grpc_channel_filter const **extra_filters, + size_t num_extra_filters, grpc_mdctx *mdctx, + const grpc_channel_args *args); const grpc_channel_args *grpc_server_get_channel_args(grpc_server *server); diff --git a/src/core/surface/server_chttp2.c b/src/core/surface/server_chttp2.c index 7e49a531df..9c02c3ef29 100644 --- a/src/core/surface/server_chttp2.c +++ b/src/core/surface/server_chttp2.c @@ -42,14 +42,13 @@ #include <grpc/support/log.h> #include <grpc/support/useful.h> -static grpc_transport_setup_result setup_transport(void *server, - grpc_transport *transport, - grpc_mdctx *mdctx) { +static void setup_transport(void *server, grpc_transport *transport, + grpc_mdctx *mdctx) { static grpc_channel_filter const *extra_filters[] = { &grpc_http_server_filter}; - return grpc_server_setup_transport(server, transport, extra_filters, - GPR_ARRAY_SIZE(extra_filters), mdctx, - grpc_server_get_channel_args(server)); + grpc_server_setup_transport(server, transport, extra_filters, + GPR_ARRAY_SIZE(extra_filters), mdctx, + grpc_server_get_channel_args(server)); } static void new_transport(void *server, grpc_endpoint *tcp) { @@ -60,9 +59,10 @@ static void new_transport(void *server, grpc_endpoint *tcp) { * (as in server_secure_chttp2.c) needs to add synchronization to avoid this * case. */ - grpc_create_chttp2_transport(setup_transport, server, - grpc_server_get_channel_args(server), tcp, NULL, - 0, grpc_mdctx_create(), 0); + grpc_mdctx *mdctx = grpc_mdctx_create(); + grpc_transport *transport = grpc_create_chttp2_transport( + grpc_server_get_channel_args(server), tcp, NULL, 0, mdctx, 0); + setup_transport(server, transport, mdctx); } /* Server callback: start listening on our ports */ |