From 9243710ca372de26823c2225c7b46b072458c671 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 28 五月 2021 17:18:33 +0800
Subject: [PATCH] tcp proxy requests, need more test.

---
 src/bh_api.cc |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/bh_api.cc b/src/bh_api.cc
index b37eaae..8690d5f 100644
--- a/src/bh_api.cc
+++ b/src/bh_api.cc
@@ -36,10 +36,7 @@
 	static std::unique_ptr<TopicNode> ptr;
 	if (!ptr && GlobalInit(BHomeShm())) {
 		auto InitLog = []() {
-			auto id = GetProcExe();
-			char path[200] = {0};
-			sprintf(path, "/opt/vasystem/valog/bhshmq_node_%s.log", id.c_str());
-			ns_log::AddLog(path);
+			ns_log::AddLog(BHLogDir() + "bhshmq_node_" + GetProcExe() + ".log");
 			return true;
 		};
 		static bool init_log = InitLog();
@@ -194,6 +191,19 @@
 	    remote, remote_len, topic, topic_len, reply, reply_len, timeout_ms);
 }
 
+int BHQueryProcs(const void *remote,
+                 const int remote_len,
+                 const void *query,
+                 const int query_len,
+                 void **reply,
+                 int *reply_len,
+                 const int timeout_ms)
+{
+	return BHApi_In2_Out1<BHAddress, MsgQueryProc, MsgQueryProcReply>(
+	    &TopicNode::QueryProcs,
+	    remote, remote_len, query, query_len, reply, reply_len, timeout_ms);
+}
+
 int BHSubscribeTopics(const void *topics, const int topics_len, void **reply, int *reply_len, const int timeout_ms)
 {
 	return BHApi_In1_Out1<MsgTopicList>(&TopicNode::Subscribe, topics, topics_len, reply, reply_len, timeout_ms);

--
Gitblit v1.8.0