From d4a1e59e1dac399a1e0117fc5184732507b212c6 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 24 六月 2021 18:15:26 +0800
Subject: [PATCH] rebuild bhome_msg.proto,bhome_msg_api.proto

---
 box/center_topic_node.cpp |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/box/center_topic_node.cpp b/box/center_topic_node.cpp
index 5c8df7a..3c4f369 100644
--- a/box/center_topic_node.cpp
+++ b/box/center_topic_node.cpp
@@ -43,11 +43,17 @@
 		proc.put("name", info.proc().name());
 		proc.put("publicInfo", info.proc().public_info());
 		proc.put("online", info.online());
-		Json topics = Json::Array();
-		for (auto &t : info.topics().topic_list()) {
-			topics.push_back(t);
-		}
-		proc.put("topics", topics);
+		auto AddTopics = [&](auto &name, auto &topic_list) {
+			Json topics = Json::Array();
+			for (auto &t : topic_list) {
+				topics.push_back(t);
+			}
+			proc.put(name, topics);
+		};
+		AddTopics("service", info.service().topic_list());
+		AddTopics("local_sub", info.local_sub().topic_list());
+		AddTopics("net_sub", info.net_sub().topic_list());
+
 		list.push_back(proc);
 	}
 	return json.dump(0);
@@ -56,7 +62,7 @@
 } // namespace
 
 CenterTopicNode::CenterTopicNode(CenterPtr center, SharedMemory &shm) :
-    pscenter_(center), pnode_(new TopicNode(shm)), run_(false) {}
+    pscenter_(center), pnode_(new TopicNode(shm, 200)), run_(false) {}
 
 CenterTopicNode::~CenterTopicNode() { Stop(); }
 
@@ -106,7 +112,7 @@
 			*reply.mutable_errmsg() = data.errmsg();
 			reply.set_data(ToJson(data));
 		} else {
-			SetError(*reply.mutable_errmsg(), eInvalidInput, "not supported topic" + request.topic());
+			SetError(*reply.mutable_errmsg(), eInvalidInput, "invalid topic: " + request.topic());
 		}
 		pnode_->ServerSendReply(src_info, reply);
 	};

--
Gitblit v1.8.0