zhangmeng
2024-04-22 16935f4aebffdd1b6580b844391a0aa0f4f3012b
src/interface_bus_api.cpp
@@ -90,6 +90,11 @@
        PRNTVITAG("topics is null");
        return false;
    }
    const auto& url = get_url(URLRegTopic);
    if (!url) {
        set_last_error("bus_register_topics url empty");
        return false;
    }
    if (get<8>(*b).empty()) {
        PRNTVITAG("proc_id is null");
@@ -112,11 +117,6 @@
    string msg(mtl2.SerializeAsString());
    std::move(mtl2);
    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);
}
@@ -140,7 +140,7 @@
    }
    const auto& url = get_url(URLQueryTopic);
    if (url.empty()) {
    if (!url) {
        set_last_error("bus_query_topic_address url empty");
        return false;
    }
@@ -178,7 +178,7 @@
    // }
    const auto& url = get_url(URLQueryProcs);
    if (url.empty()) {
    if (!url) {
        set_last_error("bus_query_procs url empty");
        return false;
    }
@@ -307,6 +307,8 @@
        PRNTVITAG("handle is null");
        return false;
    }
    if (!proc_id && !proc_id_len && !msgpub && !msgpub_len)
        return subscribe_read(NULL, NULL, timeout_ms, &get<2>(*b)) == 0;
    string topic, msg;
    auto ret = subscribe_read(&topic, &msg, timeout_ms, &get<2>(*b));
@@ -387,6 +389,8 @@
        PRNTVITAG("handle is null");
        return false;
    }
    if (!proc_id && !proc_id_len && !request && !request_len && !src)
        return read_request(NULL, NULL, timeout_ms, &get<6>(*b)) == 0;
    string msg;
    auto ret = read_request(src, &msg, timeout_ms, &get<6>(*b));