From 11f6c600e55ca5677f93624efe44d2605cdd908d Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 20:18:38 +0800
Subject: [PATCH] reserve #,@ prefix for internal proc id and topic.

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

diff --git a/box/center_topic_node.cpp b/box/center_topic_node.cpp
index 859aa8b..5c8df7a 100644
--- a/box/center_topic_node.cpp
+++ b/box/center_topic_node.cpp
@@ -29,7 +29,7 @@
 
 namespace
 {
-const std::string &kTopicQueryProc = "@center_query_procs";
+const std::string &kTopicQueryProc = "#center_query_procs";
 
 std::string ToJson(const MsgQueryProcReply &qpr)
 {
@@ -77,15 +77,18 @@
 	MsgCommonReply reply;
 
 	ProcInfo info;
-	info.set_proc_id("#center.node");
+	info.set_proc_id("@center.node");
 	info.set_name("center node");
-	if (!pnode_->UniRegister(true, info, reply, timeout)) {
+	Json jinfo;
+	jinfo.put("description", "some center services. Other nodes may use topics to use them.");
+	info.set_public_info(jinfo.dump());
+	if (!pnode_->DoRegister(true, info, reply, timeout)) {
 		throw std::runtime_error("center node register failed.");
 	}
 
 	MsgTopicList topics;
 	topics.add_topic_list(kTopicQueryProc);
-	if (!pnode_->ServerRegisterRPC(topics, reply, timeout)) {
+	if (!pnode_->DoServerRegisterRPC(true, topics, reply, timeout)) {
 		throw std::runtime_error("center node register topics failed.");
 	}
 

--
Gitblit v1.8.0