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

Method HandleBatchRequest

src/jsonrpccpp/server/rpcprotocolserverv2.cpp:42–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 }
41}
42void RpcProtocolServerV2::HandleBatchRequest(const Json::Value &req, Json::Value &response) {
43 if (req.empty())
44 this->WrapError(Json::nullValue, Errors::ERROR_RPC_INVALID_REQUEST, Errors::GetErrorMessage(Errors::ERROR_RPC_INVALID_REQUEST), response);
45 else {
46 for (unsigned int i = 0; i < req.size(); i++) {
47 Json::Value result;
48 this->HandleSingleRequest(req[i], result);
49 if (result != Json::nullValue)
50 response.append(result);
51 }
52 }
53}
54bool RpcProtocolServerV2::ValidateRequestFields(const Json::Value &request) {
55 if (!request.isObject())
56 return false;

Callers 1

HandleJsonRequestMethod · 0.95

Calls 4

WrapErrorMethod · 0.95
HandleSingleRequestMethod · 0.95
sizeMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected