mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-08 14:03:12 +02:00
JSON-RPC: RPC-over-net: track requests and handle timeouts and SQUITs.
Inform the RPC client that the request timed out / server is gone. The timeout is fixed at 15 seconds, which is fine, I think. New rpc error codes: JSON_RPC_ERROR_SERVER_GONE = -32001, /**< The request was forwarded to a remote server, but this server went gone while processing the request */ JSON_RPC_ERROR_TIMEOUT = -32002, /**< The request was forwarded to a remote server, but the request/response timed out (15 seconds) */ Unfortunately we cannot say for sure the action did not succeed at all. It could be that the request never reached the server, but it could also be that the request DID reach the server and we timed out during retrieving the response. Nothing we can do about that.
This commit is contained in:
@@ -2393,6 +2393,8 @@ typedef enum JsonRpcError {
|
||||
JSON_RPC_ERROR_INTERNAL_ERROR = -32603, /**< Internal server error */
|
||||
// UnrealIRCd JSON-RPC server specific error codes:
|
||||
JSON_RPC_ERROR_API_CALL_DENIED = -32000, /**< The api user does not have enough permissions to do this call */
|
||||
JSON_RPC_ERROR_SERVER_GONE = -32001, /**< The request was forwarded to a remote server, but this server went gone while processing the request */
|
||||
JSON_RPC_ERROR_TIMEOUT = -32002, /**< The request was forwarded to a remote server, but the request/response timed out (15 seconds) */
|
||||
// UnrealIRCd specific application error codes:
|
||||
JSON_RPC_ERROR_NOT_FOUND = -1000, /**< Target not found (no such nick / channel / ..) */
|
||||
JSON_RPC_ERROR_ALREADY_EXISTS = -1001, /**< Resource already exists by that name (eg on nickchange request, a gline, etc) */
|
||||
|
||||
Reference in New Issue
Block a user