1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 07:43:12 +02:00

JSON-RPC: Use proper error response with error codes according to

the official specification (one of JSON_RPC_ERROR_*).

Add proper rpc_error() and rpc_error_fmt()

Don't steal reference in rpc_response().
This commit is contained in:
Bram Matthys
2022-06-06 17:18:22 +02:00
parent 4cd520d327
commit 61ba3727df
6 changed files with 84 additions and 15 deletions
+5 -1
View File
@@ -1407,7 +1407,11 @@ void rpc_response_default_handler(Client *client, json_t *request, json_t *resul
{
}
void rpc_error_default_handler(Client *client, json_t *request, const char *msg)
void rpc_error_default_handler(Client *client, json_t *request, int error_code, const char *error_message)
{
}
void rpc_error_fmt_default_handler(Client *client, json_t *request, int error_code, const char *fmt, ...)
{
}