diff options
Diffstat (limited to 'src/core/ext/transport/chttp2/server')
-rw-r--r-- | src/core/ext/transport/chttp2/server/chttp2_server.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/ext/transport/chttp2/server/chttp2_server.cc b/src/core/ext/transport/chttp2/server/chttp2_server.cc index 05aeede07a..0b0adb9786 100644 --- a/src/core/ext/transport/chttp2/server/chttp2_server.cc +++ b/src/core/ext/transport/chttp2/server/chttp2_server.cc @@ -37,6 +37,7 @@ #include "src/core/lib/channel/channel_args.h" #include "src/core/lib/channel/handshaker.h" #include "src/core/lib/channel/handshaker_registry.h" +#include "src/core/lib/gpr/host_port.h" #include "src/core/lib/iomgr/endpoint.h" #include "src/core/lib/iomgr/resolve_address.h" #include "src/core/lib/iomgr/resource_quota.h" @@ -362,9 +363,14 @@ grpc_error* grpc_chttp2_server_add_port(grpc_server* server, const char* addr, arg = grpc_channel_args_find(args, GRPC_ARG_ENABLE_CHANNELZ); if (grpc_channel_arg_get_bool(arg, false)) { + char* host; + char* port; + gpr_split_host_port(addr, &host, &port); + // allocated host's ownership is passed to ListenSocketNode. state->channelz_listen_socket = grpc_core::MakeRefCounted<grpc_core::channelz::ListenSocketNode>( - *port_num); + host, *port_num); + gpr_free(port); socket_uuid = state->channelz_listen_socket->uuid(); } |