From 2d92571cf9f171479163bd386b12c49e5805113a Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 15 Jun 2011 00:19:07 +0900 Subject: Moved jsonRpc flag from RpcMethod to RpcRequest. Now RpcMethod is stateless, so we can cache and reuse them. --- src/HttpServerBodyCommand.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/HttpServerBodyCommand.cc') diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc index 268cc31b..e8c063e5 100644 --- a/src/HttpServerBodyCommand.cc +++ b/src/HttpServerBodyCommand.cc @@ -179,6 +179,7 @@ HttpServerBodyCommand::processJsonRpcRequest(const Dict* jsondict) return createJsonRpcErrorResponse(-32602, "Invalid params.", id); } rpc::RpcRequest req(methodName->s(), params, id); + req.jsonRpc = true; SharedHandle method; try { method = rpc::RpcMethodFactory::create(req.methodName); @@ -186,7 +187,6 @@ HttpServerBodyCommand::processJsonRpcRequest(const Dict* jsondict) A2_LOG_INFO_EX(EX_EXCEPTION_CAUGHT, e); return createJsonRpcErrorResponse(-32601, "Method not found.", id); } - method->setJsonRpc(true); A2_LOG_INFO(fmt("Executing RPC method %s", req.methodName.c_str())); rpc::RpcResponse res = method->execute(req, e_); return res; -- cgit