diff options
author | Sadie Powell <sadie@witchery.services> | 2025-02-18 20:54:58 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2025-02-18 21:27:46 +0000 |
commit | 8330cd119ac390036cb5cadd51019e6b496c1bfc (patch) | |
tree | 6e15d5e595bda5e16e72252fd107991c7a0ac8e1 /modules/rpc/jsonrpc.cpp | |
parent | 3c55fbe6509c1706d21136392a4bfb2295a99a35 (diff) |
Fix sending RPC responses after the previous commit.
Diffstat (limited to 'modules/rpc/jsonrpc.cpp')
-rw-r--r-- | modules/rpc/jsonrpc.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/modules/rpc/jsonrpc.cpp b/modules/rpc/jsonrpc.cpp index 8c16f4cc8..cd24dc55c 100644 --- a/modules/rpc/jsonrpc.cpp +++ b/modules/rpc/jsonrpc.cpp @@ -122,13 +122,8 @@ public: return true; } - event->second->Run(this, client, request); - - if (request.GetError()) - { - SendError(reply, request.GetError()->first, request.GetError()->second, id); - return true; - } + if (!event->second->Run(this, client, request)) + return false; this->Reply(request); return true; @@ -136,6 +131,12 @@ public: void Reply(RPCRequest &request) override { + if (request.GetError()) + { + SendError(request.reply, request.GetError()->first, request.GetError()->second, request.id); + return; + } + // {"jsonrpc": "2.0", "method": "update", "params": [1,2,3,4,5]} auto* doc = yyjson_mut_doc_new(nullptr); |