mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
Locking fixes.
This commit is contained in:
@@ -49,12 +49,15 @@ Json::Value WSConnection::invokeCommand(Json::Value& jvRequest)
|
|||||||
Json::Value jvResult(Json::objectValue);
|
Json::Value jvResult(Json::objectValue);
|
||||||
|
|
||||||
// Regular RPC command
|
// Regular RPC command
|
||||||
jvResult["result"] = mRPCHandler.doCommand(
|
{
|
||||||
jvRequest["command"].asString(),
|
boost::recursive_mutex::scoped_lock sl(theApp->getMasterLock());
|
||||||
jvRequest.isMember("params")
|
jvResult["result"] = mRPCHandler.doCommand(
|
||||||
? jvRequest["params"]
|
jvRequest["command"].asString(),
|
||||||
: jvRequest,
|
jvRequest.isMember("params")
|
||||||
mHandler->getPublic() ? RPCHandler::GUEST : RPCHandler::ADMIN);
|
? jvRequest["params"]
|
||||||
|
: jvRequest,
|
||||||
|
mHandler->getPublic() ? RPCHandler::GUEST : RPCHandler::ADMIN);
|
||||||
|
}
|
||||||
|
|
||||||
// Currently we will simply unwrap errors returned by the RPC
|
// Currently we will simply unwrap errors returned by the RPC
|
||||||
// API, in the future maybe we can make the responses
|
// API, in the future maybe we can make the responses
|
||||||
|
|||||||
@@ -116,7 +116,14 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
send(cpClient, mMap[cpClient]->invokeCommand(jvRequest));
|
boost::shared_ptr<WSConnection> conn;
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock sl(mMapLock);
|
||||||
|
conn = mMap[cpClient];
|
||||||
|
}
|
||||||
|
if (!conn)
|
||||||
|
return;
|
||||||
|
send(cpClient, conn->invokeCommand(jvRequest));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user