mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 04:25:51 +00:00
Distinguish between excess server load and excessive connection work.
This commit is contained in:
@@ -72,6 +72,7 @@ Json::Value rpcError(int iError, Json::Value jvResult)
|
|||||||
{ rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown method." },
|
{ rpcUNKNOWN_COMMAND, "unknownCmd", "Unknown method." },
|
||||||
{ rpcWRONG_SEED, "wrongSeed", "The regular key does not point as the master key." },
|
{ rpcWRONG_SEED, "wrongSeed", "The regular key does not point as the master key." },
|
||||||
{ rpcTOO_BUSY, "tooBusy", "The server is too busy to help you now." },
|
{ rpcTOO_BUSY, "tooBusy", "The server is too busy to help you now." },
|
||||||
|
{ rpcSLOW_DOWN, "slowDown", "You are placing too much load on the server." },
|
||||||
};
|
};
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ enum {
|
|||||||
rpcNO_EVENTS,
|
rpcNO_EVENTS,
|
||||||
rpcNOT_STANDALONE,
|
rpcNOT_STANDALONE,
|
||||||
rpcTOO_BUSY,
|
rpcTOO_BUSY,
|
||||||
|
rpcSLOW_DOWN,
|
||||||
|
|
||||||
// Networking
|
// Networking
|
||||||
rpcNO_CLOSED,
|
rpcNO_CLOSED,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public:
|
|||||||
connection_ptr ptr = mConnection.lock();
|
connection_ptr ptr = mConnection.lock();
|
||||||
if (ptr)
|
if (ptr)
|
||||||
ptr->close(websocketpp::close::status::PROTOCOL_ERROR, "overload");
|
ptr->close(websocketpp::close::status::PROTOCOL_ERROR, "overload");
|
||||||
return rpcError(rpcTOO_BUSY);
|
return rpcError(rpcSLOW_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!jvRequest.isMember("command"))
|
if (!jvRequest.isMember("command"))
|
||||||
|
|||||||
Reference in New Issue
Block a user