| 17 | RpcProtocolServerV2::RpcProtocolServerV2(IProcedureInvokationHandler &handler) : AbstractProtocolHandler(handler) {} |
| 18 | |
| 19 | void 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 | } |
| 30 | void RpcProtocolServerV2::HandleSingleRequest(const Json::Value &req, Json::Value &response) { |
| 31 | int error = this->ValidateRequest(req); |
| 32 | if (error == 0) { |
nothing calls this directly
no test coverage detected