mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
Reverts the last 2 Rpc changes (#114)
* Revert "Fully asigns the ConnectionInfo struct (#113)" This reverts commit9a3100b221. * Revert "Passes the ConnectionInfo of the Rpc client on server callback (#112)" This reverts commit7e9754acff.
This commit is contained in:
committed by
Peter Johnson
parent
9a3100b221
commit
e952236e1a
@@ -346,20 +346,8 @@ void Storage::ProcessIncoming(std::shared_ptr<Message> msg,
|
||||
DEBUG("received RPC call to non-RPC entry");
|
||||
return;
|
||||
}
|
||||
ConnectionInfo conn_info;
|
||||
auto c = conn_weak.lock();
|
||||
if (c) {
|
||||
conn_info = c->info();
|
||||
} else {
|
||||
conn_info.remote_id = "Unknown";
|
||||
conn_info.remote_ip = "Unknown";
|
||||
conn_info.remote_port = 0;
|
||||
conn_info.last_update = 0;
|
||||
conn_info.protocol_version = 0;
|
||||
}
|
||||
m_rpc_server.ProcessRpc(entry->name, msg, entry->rpc_callback,
|
||||
conn->uid(), conn_info,
|
||||
[=](std::shared_ptr<Message> msg) {
|
||||
conn->uid(), [=](std::shared_ptr<Message> msg) {
|
||||
auto c = conn_weak.lock();
|
||||
if (c) c->QueueOutgoing(msg);
|
||||
});
|
||||
@@ -1404,15 +1392,8 @@ unsigned int Storage::CallRpc(StringRef name, StringRef params) {
|
||||
// gracefully anyway.
|
||||
auto rpc_callback = entry->rpc_callback;
|
||||
lock.unlock();
|
||||
ConnectionInfo conn_info;
|
||||
conn_info.remote_id = "Server";
|
||||
conn_info.remote_ip = "localhost";
|
||||
conn_info.remote_port = 0;
|
||||
conn_info.last_update = 0;
|
||||
conn_info.protocol_version = 0x3000;
|
||||
m_rpc_server.ProcessRpc(
|
||||
name, msg, rpc_callback, 0xffffU, conn_info,
|
||||
[this](std::shared_ptr<Message> msg) {
|
||||
name, msg, rpc_callback, 0xffffU, [this](std::shared_ptr<Message> msg) {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
m_rpc_results.insert(std::make_pair(
|
||||
std::make_pair(msg->id(), msg->seq_num_uid()), msg->str()));
|
||||
|
||||
Reference in New Issue
Block a user