summaryrefslogtreecommitdiff
path: root/src/HttpServerBodyCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-15 00:19:07 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-06-15 00:19:07 +0900
commit2d92571cf9f171479163bd386b12c49e5805113a (patch)
treeff277be0f8851feb4929318568845c5238062f73 /src/HttpServerBodyCommand.cc
parentba9673be1dcbf2a164a5899848230b6ff1b138f0 (diff)
Moved jsonRpc flag from RpcMethod to RpcRequest.
Now RpcMethod is stateless, so we can cache and reuse them.
Diffstat (limited to 'src/HttpServerBodyCommand.cc')
-rw-r--r--src/HttpServerBodyCommand.cc2
1 files changed, 1 insertions, 1 deletions
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<rpc::RpcMethod> 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;