zhangmeng
2022-04-11 f552a0ea788225d8fe80942d6e8bd6500f788393
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());