From 330f78f3334bcdcdb4cc2ab2dbf66604e0224d71 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 21 五月 2021 16:21:45 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/valib/bhshmq
---
src/topic_node.cpp | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/topic_node.cpp b/src/topic_node.cpp
index fce7ed6..124d329 100644
--- a/src/topic_node.cpp
+++ b/src/topic_node.cpp
@@ -143,8 +143,14 @@
for (auto &p : sockets_) { p->Stop(); }
}
-bool TopicNode::Register(ProcInfo &proc, MsgCommonReply &reply_body, const int timeout_ms)
+bool TopicNode::UniRegister(const bool internal, ProcInfo &proc, MsgCommonReply &reply_body, const int timeout_ms)
{
+ auto ValidUserProcId = [](const std::string &id) { return !id.empty() && id[0] != '#'; };
+ if (!internal && !ValidUserProcId(proc.proc_id())) {
+ SetLastError(eInvalidInput, "invalid proc id :'" + proc.proc_id() + "'");
+ return false;
+ }
+
{
std::lock_guard<std::mutex> lk(mutex_);
info_ = proc;
--
Gitblit v1.8.0