From c4bef30615743c72e8b1d96c2b74529cfd55b585 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期二, 07 六月 2022 14:41:46 +0800 Subject: [PATCH] 完善arm64交叉编译 --- src/interface_bus_api.cpp | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/interface_bus_api.cpp b/src/interface_bus_api.cpp index 65dd669..638f31a 100644 --- a/src/interface_bus_api.cpp +++ b/src/interface_bus_api.cpp @@ -108,8 +108,12 @@ } string msg(mtl2.SerializeAsString()); - - return simple_request(get_url(URLRegTopic), msg.data(), msg.size(), reply, reply_len, timeout_ms); + const auto& url = get_url(URLRegTopic); + if (url.empty()) { + set_last_error("bus_register_topics url empty"); + return false; + } + return simple_request(url, msg.data(), msg.size(), reply, reply_len, timeout_ms); } int bus_query_topic_address(void* handle, const void *remote, @@ -132,6 +136,10 @@ } auto url(get_url(URLQueryTopic)); + if (url.empty()) { + set_last_error("bus_query_topic_address url empty"); + return false; + } // if (remote && remote_len > 0){ // BHAddress addr; @@ -166,7 +174,10 @@ } auto url(get_url(URLQueryProcs)); - + if (url.empty()) { + set_last_error("bus_query_procs url empty"); + return false; + } // if (remote && remote_len > 0){ // BHAddress addr; // if (addr.ParseFromArray(remote, remote_len)){ @@ -344,7 +355,10 @@ } } } - + if (url.empty()) { + set_last_error("bus_request url empty"); + return false; + } int rc = request2(url, request, request_len, reply, reply_len, timeout_ms); if (rc < 0) return false; copy_memory(proc_id, proc_id_len, procid.data(), procid.size()); -- Gitblit v1.8.0