MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / HandleJsonRequest

Method HandleJsonRequest

src/jsonrpccpp/server/rpcprotocolserverv2.cpp:19–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17RpcProtocolServerV2::RpcProtocolServerV2(IProcedureInvokationHandler &handler) : AbstractProtocolHandler(handler) {}
18
19void RpcProtocolServerV2::HandleJsonRequest(const Json::Value &req, Json::Value &response) {
20 // It could be a Batch Request
21 if (req.isArray()) {
22 this->HandleBatchRequest(req, response);
23 } // It could be a simple Request
24 else if (req.isObject()) {
25 this->HandleSingleRequest(req, response);
26 } else {
27 this->WrapError(Json::nullValue, Errors::ERROR_RPC_INVALID_REQUEST, Errors::GetErrorMessage(Errors::ERROR_RPC_INVALID_REQUEST), response);
28 }
29}
30void RpcProtocolServerV2::HandleSingleRequest(const Json::Value &req, Json::Value &response) {
31 int error = this->ValidateRequest(req);
32 if (error == 0) {

Callers

nothing calls this directly

Calls 3

HandleBatchRequestMethod · 0.95
HandleSingleRequestMethod · 0.95
WrapErrorMethod · 0.95

Tested by

no test coverage detected