aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/channel
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-10-29 12:06:57 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-10-29 12:06:57 -0700
commit679abd779ae3c06361e868b45c970258f4353fab (patch)
tree0dd1b095bc06b6527496f40b54bf8ff3dac90529 /src/core/lib/channel
parent08519d44729c95b2f62a661ec846aa40448a5ef4 (diff)
Actually track listening address
Diffstat (limited to 'src/core/lib/channel')
-rw-r--r--src/core/lib/channel/channelz.cc8
-rw-r--r--src/core/lib/channel/channelz.h4
2 files changed, 8 insertions, 4 deletions
diff --git a/src/core/lib/channel/channelz.cc b/src/core/lib/channel/channelz.cc
index 393abcef98..4a32b1f39a 100644
--- a/src/core/lib/channel/channelz.cc
+++ b/src/core/lib/channel/channelz.cc
@@ -374,8 +374,10 @@ grpc_json* SocketNode::RenderJson() {
return top_level_json;
}
-ListenSocketNode::ListenSocketNode(int port)
- : BaseNode(EntityType::kSocket), port_(port) {}
+ListenSocketNode::ListenSocketNode(char* host, int port)
+ : BaseNode(EntityType::kSocket),
+ host_(UniquePtr<char>(host)),
+ port_(port) {}
grpc_json* ListenSocketNode::RenderJson() {
// We need to track these three json objects to build our object
@@ -402,7 +404,7 @@ grpc_json* ListenSocketNode::RenderJson() {
json_iterator =
grpc_json_add_number_string_child(json, json_iterator, "port", port_);
json_iterator = grpc_json_create_child(json_iterator, json, "ip_address",
- "127.0 0.1", GRPC_JSON_STRING, false);
+ host_.get(), GRPC_JSON_STRING, false);
return top_level_json;
}
diff --git a/src/core/lib/channel/channelz.h b/src/core/lib/channel/channelz.h
index 9ee7dfa91f..2c6fd01006 100644
--- a/src/core/lib/channel/channelz.h
+++ b/src/core/lib/channel/channelz.h
@@ -268,12 +268,14 @@ class SocketNode : public BaseNode {
// Handles channelz bookkeeping for listen sockets
class ListenSocketNode : public BaseNode {
public:
- ListenSocketNode(int port);
+ // ListenSocketNode takes ownership of host.
+ ListenSocketNode(char* host, int port);
~ListenSocketNode() override {}
grpc_json* RenderJson() override;
private:
+ UniquePtr<char> host_;
int port_;
};