diff options
Diffstat (limited to 'src/core/surface/server_chttp2.c')
-rw-r--r-- | src/core/surface/server_chttp2.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/surface/server_chttp2.c b/src/core/surface/server_chttp2.c index 5ce7c1955b..6e21d2dcd7 100644 --- a/src/core/surface/server_chttp2.c +++ b/src/core/surface/server_chttp2.c @@ -1,6 +1,6 @@ /* * - * Copyright 2015, Google Inc. + * Copyright 2015-2016, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,7 +53,8 @@ static void setup_transport(grpc_exec_ctx *exec_ctx, void *server, } static void new_transport(grpc_exec_ctx *exec_ctx, void *server, - grpc_endpoint *tcp) { + grpc_endpoint *tcp, + grpc_tcp_server_acceptor *acceptor) { /* * Beware that the call to grpc_create_chttp2_transport() has to happen before * grpc_tcp_server_destroy(). This is fine here, but similar code @@ -80,7 +81,8 @@ static void start(grpc_exec_ctx *exec_ctx, grpc_server *server, void *tcpp, static void destroy(grpc_exec_ctx *exec_ctx, grpc_server *server, void *tcpp, grpc_closure *destroy_done) { grpc_tcp_server *tcp = tcpp; - grpc_tcp_server_destroy(exec_ctx, tcp, destroy_done); + grpc_tcp_server_unref(exec_ctx, tcp); + grpc_exec_ctx_enqueue(exec_ctx, destroy_done, 1); } int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) { @@ -100,15 +102,13 @@ int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) { goto error; } - tcp = grpc_tcp_server_create(); + tcp = grpc_tcp_server_create(NULL); GPR_ASSERT(tcp); for (i = 0; i < resolved->naddrs; i++) { - grpc_tcp_listener *listener; - listener = grpc_tcp_server_add_port( + port_temp = grpc_tcp_server_add_port( tcp, (struct sockaddr *)&resolved->addrs[i].addr, resolved->addrs[i].len); - port_temp = grpc_tcp_listener_get_port(listener); if (port_temp > 0) { if (port_num == -1) { port_num = port_temp; @@ -139,7 +139,7 @@ error: grpc_resolved_addresses_destroy(resolved); } if (tcp) { - grpc_tcp_server_destroy(&exec_ctx, tcp, NULL); + grpc_tcp_server_unref(&exec_ctx, tcp); } port_num = 0; |