Browse Source

Merge pull request #6362

72b9452 When processing RPC commands during warmup phase, parse the request object before returning an error so that id value can be used in the response. (Forrest Voight)
0.13
Wladimir J. van der Laan 10 years ago
parent
commit
d6db1157bc
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 14
      src/rpcserver.cpp

14
src/rpcserver.cpp

@ -931,13 +931,6 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn, @@ -931,13 +931,6 @@ static bool HTTPReq_JSONRPC(AcceptedConnection *conn,
if (!valRequest.read(strRequest))
throw JSONRPCError(RPC_PARSE_ERROR, "Parse error");
// Return immediately if in warmup
{
LOCK(cs_rpcWarmup);
if (fRPCInWarmup)
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
}
string strReply;
// singleton request
@ -1009,6 +1002,13 @@ void ServiceConnection(AcceptedConnection *conn) @@ -1009,6 +1002,13 @@ void ServiceConnection(AcceptedConnection *conn)
UniValue CRPCTable::execute(const std::string &strMethod, const UniValue &params) const
{
// Return immediately if in warmup
{
LOCK(cs_rpcWarmup);
if (fRPCInWarmup)
throw JSONRPCError(RPC_IN_WARMUP, rpcWarmupStatus);
}
// Find method
const CRPCCommand *pcmd = tableRPC[strMethod];
if (!pcmd)

Loading…
Cancel
Save