Simplify and fix ebt.replicate.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4112 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-01-09 22:37:34 +00:00
parent 69253432b8
commit 80a1e94da4
2 changed files with 41 additions and 56 deletions

View File

@ -603,7 +603,7 @@ void tf_ssb_connection_rpc_send_json(tf_ssb_connection_t* connection, uint8_t fl
const char* json_string = JS_ToCStringLen(context, &size, json);
tf_ssb_connection_rpc_send(
connection,
k_ssb_rpc_flag_json | (flags & k_ssb_rpc_flag_stream),
k_ssb_rpc_flag_json | (flags & k_ssb_rpc_flag_stream) | (flags & k_ssb_rpc_flag_end_error),
request_number,
(const uint8_t*)json_string,
size,
@ -621,7 +621,7 @@ void tf_ssb_connection_rpc_send_error(tf_ssb_connection_t* connection, uint8_t f
JS_SetPropertyStr(context, message, "name", JS_NewString(context, "Error"));
JS_SetPropertyStr(context, message, "stack", JS_NewString(context, "none"));
JS_SetPropertyStr(context, message, "message", JS_NewString(context, error));
tf_ssb_connection_rpc_send_json(connection, flags, request_number, message, NULL, NULL, NULL);
tf_ssb_connection_rpc_send_json(connection, flags | k_ssb_rpc_flag_end_error, request_number, message, NULL, NULL, NULL);
JS_FreeValue(context, message);
}