lichao
2021-05-20 0e31f38fc37216e1376d8101d1bcf7a3779279dc
box/node_center.cpp
@@ -350,13 +350,14 @@
      return MakeReply(eSuccess);
   });
}
MsgQueryProcReply NodeCenter::QueryProc(const BHMsgHead &head, const MsgQueryProc &req)
MsgQueryProcReply NodeCenter::QueryProc(const std::string &proc_id)
{
   typedef MsgQueryProcReply Reply;
   auto query = [&](Node self) -> Reply {
      auto Add1 = [](Reply &reply, Node node) {
         auto info = reply.add_proc_list();
         *info->mutable_proc() = node->proc_;
      info->mutable_proc()->clear_private_info();
         info->set_online(node->state_.flag_ == kStateNormal);
         for (auto &addr_topics : node->services_) {
            for (auto &topic : addr_topics.second) {
@@ -365,8 +366,8 @@
         }
      };
      if (!req.proc_id().empty()) {
         auto pos = online_node_addr_map_.find(req.proc_id());
   if (!proc_id.empty()) {
      auto pos = online_node_addr_map_.find(proc_id);
         if (pos == online_node_addr_map_.end()) {
            return MakeReply<Reply>(eNotFound, "proc not found.");
         } else {
@@ -386,8 +387,11 @@
         }
         return reply;
      }
   };
}
MsgQueryProcReply NodeCenter::QueryProc(const BHMsgHead &head, const MsgQueryProc &req)
{
   typedef MsgQueryProcReply Reply;
   auto query = [&](Node self) -> Reply { return this->QueryProc(req.proc_id()); };
   return HandleMsg<Reply>(head, query);
}