Remove support for RPC style calls over websocket.

This commit is contained in:
Arthur Britto
2012-12-06 20:22:02 -08:00
parent 8ad9d62641
commit 0f9cdb1c8b

View File

@@ -38,7 +38,6 @@ public:
WSConnection(WSServerHandler<endpoint_type>* wshpHandler, connection_ptr cpConnection) WSConnection(WSServerHandler<endpoint_type>* wshpHandler, connection_ptr cpConnection)
: mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()) { ; } : mHandler(wshpHandler), mConnection(cpConnection), mNetwork(theApp->getOPs()) { ; }
virtual ~WSConnection() virtual ~WSConnection()
{ {
mNetwork.unsubTransactions(this); mNetwork.unsubTransactions(this);
@@ -70,33 +69,12 @@ public:
return jvResult; return jvResult;
} }
RPCHandler mRPCHandler(&mNetwork, this); RPCHandler mRPCHandler(&mNetwork, this);
Json::Value jvResult(Json::objectValue); Json::Value jvResult(Json::objectValue);
// XXX Temporarily support RPC style commands over websocket. Remove this. jvResult["result"] = mRPCHandler.doCommand(
if (jvRequest.isMember("params")) jvRequest,
{ mHandler->getPublic() ? RPCHandler::GUEST : RPCHandler::ADMIN);
RPCParser rpParser;
Json::Value jvRpcRequest = rpParser.parseCommand(jvRequest["command"].asString(), jvRequest["params"]);
if (jvRpcRequest.isMember("error"))
{
jvResult = jvRpcRequest;
}
else
{
jvResult["result"] = mRPCHandler.doCommand(
jvRpcRequest,
mHandler->getPublic() ? RPCHandler::GUEST : RPCHandler::ADMIN);
}
}
else
{
jvResult["result"] = mRPCHandler.doCommand(
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
@@ -122,7 +100,6 @@ public:
return jvResult; return jvResult;
} }
}; };