From 94a455aba299af5ffe476560d859dfd007cd5467 Mon Sep 17 00:00:00 2001
From: lichao <lichao@aiotlink.com>
Date: 星期五, 16 四月 2021 12:13:43 +0800
Subject: [PATCH] fix crash by using normal timeout; add sendq todo.

---
 src/topic_node.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/topic_node.cpp b/src/topic_node.cpp
index e9e627f..f947f98 100644
--- a/src/topic_node.cpp
+++ b/src/topic_node.cpp
@@ -245,7 +245,10 @@
 
 bool TopicNode::ClientAsyncRequest(const MsgRequestTopic &req, std::string &out_msg_id, const RequestResultCB &cb)
 {
-	if (!IsRegistered()) { return false; }
+	if (!IsRegistered()) {
+		SetLastError(eNotRegistered, "Not Registered.");
+		return false;
+	}
 
 	const std::string &msg_id(NewMsgId());
 
@@ -298,6 +301,7 @@
 		return sock.Send(&BHTopicCenterAddress(), head, query, onQueryResult);
 
 	} catch (...) {
+		SetLastError(eError, "internal error.");
 		return false;
 	}
 }

--
Gitblit v1.8.0