Refactor JSON and RPC API

This commit is contained in:
Sergey Lyubka committed 2022-07-30 07:55:26 +01:00
1 parent a4b003b7ac
commit 54d6bad5e5
11 files changed
+703 -694

No files matched your search

+3 -2
View File
@@ -46,8 +46,9 @@ static void fn(struct mg_connection *c, int ev, void *ev_data, void *fn_data) {
// Got websocket frame. Received data is wm->data
struct mg_ws_message *wm = (struct mg_ws_message *) ev_data;
char *resp = NULL;
mg_rpc_process(&s_rpc_head, wm->data, mg_pfn_realloc, &resp);
mg_ws_send(c, resp, strlen(resp), WEBSOCKET_OP_TEXT);
struct mg_rpc_req r = {&s_rpc_head, mg_pfn_realloc, &resp, 0, 0, wm->data};
mg_rpc_process(&r);
if (resp) mg_ws_send(c, resp, strlen(resp), WEBSOCKET_OP_TEXT);
free(resp);
}
(void) fn_data;
File diff suppressed because it is too large. Load diff