diff options
-rw-r--r-- | src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c index d625ed1d9e..96bf4d6f30 100644 --- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c @@ -38,6 +38,7 @@ #ifdef GPR_SUPPORT_CHANNELS_FROM_FD +#include <grpc/support/alloc.h> #include <grpc/support/string_util.h> #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" @@ -52,12 +53,15 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server, grpc_completion_queue *cq, int fd) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + char *name; gpr_asprintf(&name, "fd:%d", fd); grpc_endpoint *server_endpoint = grpc_tcp_create( grpc_fd_create(fd, name), GRPC_TCP_DEFAULT_READ_SLICE_SIZE, name); + gpr_free(name); + const grpc_channel_args *server_args = grpc_server_get_channel_args(server); grpc_transport *transport = grpc_create_chttp2_transport( &exec_ctx, server_args, server_endpoint, 0 /* is_client */); |