Use tf_ssb_connection_rpc_send_json everywhere I can. Less code, and fixes some leaks.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4122 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-01-14 19:32:36 +00:00
parent 8a1b4cceec
commit 3269c7ca45
3 changed files with 17 additions and 88 deletions

View File

@ -411,20 +411,14 @@ void tf_ssb_test_rooms(const tf_test_options_t* options)
JS_SetPropertyStr(context, message, "args", args);
JS_SetPropertyStr(context, message, "type", JS_NewString(context, "duplex"));
JSValue message_json = JS_JSONStringify(context, message, JS_NULL, JS_NULL);
size_t size;
const char* raw = JS_ToCStringLen(context, &size, message_json);
tf_ssb_connection_rpc_send(
tf_ssb_connection_rpc_send_json(
connections[0],
k_ssb_rpc_flag_json | k_ssb_rpc_flag_stream,
k_ssb_rpc_flag_stream,
tunnel_request_number,
(const uint8_t*)raw,
size,
message,
NULL,
NULL,
NULL);
JS_FreeCString(context, raw);
JS_FreeValue(context, message_json);
JS_FreeValue(context, message);
tf_ssb_connection_t* tun0 = tf_ssb_connection_tunnel_create(ssb1, id0, tunnel_request_number, id2);