diff --git a/components/net/cpp/src/dispatcher.cpp b/components/net/cpp/src/dispatcher.cpp index a7d504627bb863b9cee8ba5976fe0b01fed211e3..3231b8ddc4604c7929a04c5c33a36385e1bd94ea 100644 --- a/components/net/cpp/src/dispatcher.cpp +++ b/components/net/cpp/src/dispatcher.cpp @@ -65,15 +65,15 @@ void ftl::net::Dispatcher::dispatch_call(Peer &s, const msgpack::object &msg) { // assert(type == 0); if (type == 1) { - LOG(INFO) << "RPC return for " << id; + //DLOG(INFO) << "RPC return for " << id; s._dispatchResponse(id, args); } else if (type == 0) { - LOG(INFO) << "RPC " << name << "() <- " << s.getURI(); + //DLOG(INFO) << "RPC " << name << "() <- " << s.getURI(); auto func = _locateHandler(name); if (func) { - LOG(INFO) << "Found binding for " << name; + //DLOG(INFO) << "Found binding for " << name; try { auto result = (*func)(args); //->get(); s._sendResponse(id, result->get()); diff --git a/components/net/cpp/src/peer.cpp b/components/net/cpp/src/peer.cpp index 5c7b9acdc0608917aa61dd6d786be4cc4b2bd2c7..25059b5473c154d31ea6b31950a3e5e5eff02de8 100644 --- a/components/net/cpp/src/peer.cpp +++ b/components/net/cpp/src/peer.cpp @@ -514,11 +514,11 @@ bool Peer::_data() { _data(); }); - if (status_ != kConnected) { + if (status_ == kConnecting) { // If not connected, must lock to make sure no other thread performs this step UNIQUE_LOCK(recv_mtx_,lk); // Verify still not connected after lock - if (status_ != kConnected) { + if (status_ == kConnecting) { // First message must be a handshake try { tuple<uint32_t, std::string, msgpack::object> hs; @@ -554,7 +554,7 @@ void Peer::_dispatchResponse(uint32_t id, msgpack::object &res) { // TODO: Handle error reporting... UNIQUE_LOCK(cb_mtx_,lk); if (callbacks_.count(id) > 0) { - DLOG(1) << "Received return RPC value"; + //DLOG(1) << "Received return RPC value"; // Allow for unlock before callback auto cb = std::move(callbacks_[id]); @@ -576,7 +576,6 @@ void Peer::cancelCall(int id) { } void Peer::_sendResponse(uint32_t id, const msgpack::object &res) { - LOG(INFO) << "Sending response: " << id; Dispatcher::response_t res_obj = std::make_tuple(1,id,std::string(""),res); UNIQUE_LOCK(send_mtx_,lk); if (scheme_ == ftl::URI::SCHEME_WS) send_buf_.append_ref(nullptr,0);