From fb3ad0d95d12858a727cac73ccda941e3c230800 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 9 Jul 2022 14:23:58 +0000 Subject: [PATCH] Slight cleanup. git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3921 ed5197a5-7fde-0310-b194-c3ffbd925b24 --- core/ssb.js | 1 - src/ssb.c | 4 ++-- src/ssb.js.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/core/ssb.js b/core/ssb.js index c40272d9..753364eb 100644 --- a/core/ssb.js +++ b/core/ssb.js @@ -188,7 +188,6 @@ ssb.addRpc(['blobs', 'get'], function(request) { } request.send_json_end(true); } - request.more(function(request) {}); }); ssb.addRpc(['gossip', 'ping'], function(request) { diff --git a/src/ssb.c b/src/ssb.c index 4ba6fafe..682dde32 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -1102,7 +1102,7 @@ static void _tf_ssb_connection_rpc_recv(tf_ssb_connection_t* connection, uint8_t { if (_tf_ssb_name_equals(context, val, it->name)) { - it->callback(connection, flags, request_number, JS_DupValue(context, val), NULL, 0, it->user_data); + it->callback(connection, flags, request_number, val, NULL, 0, it->user_data); found = true; break; } @@ -1116,7 +1116,7 @@ static void _tf_ssb_connection_rpc_recv(tf_ssb_connection_t* connection, uint8_t { if (callback) { - callback(connection, flags, request_number, JS_DupValue(context, val), NULL, 0, user_data); + callback(connection, flags, request_number, val, NULL, 0, user_data); } } else diff --git a/src/ssb.js.c b/src/ssb.js.c index 25a6aca0..d5c9cabd 100644 --- a/src/ssb.js.c +++ b/src/ssb.js.c @@ -458,7 +458,7 @@ void _tf_ssb_on_rpc(tf_ssb_connection_t* connection, uint8_t flags, int32_t requ JS_SetPropertyStr(context, object, "flags", JS_NewUint32(context, flags)); JS_SetPropertyStr(context, object, "request_number", JS_NewInt32(context, request_number)); JS_SetPropertyStr(context, object, "args", JS_GetPropertyStr(context, args, "args")); - JS_SetPropertyStr(context, object, "message", message && size ? JS_NewArrayBufferCopy(context, message, size) : args); + JS_SetPropertyStr(context, object, "message", message && size ? JS_NewArrayBufferCopy(context, message, size) : JS_DupValue(context, args)); JS_SetPropertyStr(context, object, "send_json", JS_NewCFunction(context, _tf_ssb_rpc_send_json, "send_json", 1)); JS_SetPropertyStr(context, object, "send_binary", JS_NewCFunction(context, _tf_ssb_rpc_send_binary, "send_binary", 1)); JS_SetPropertyStr(context, object, "send_json_end", JS_NewCFunction(context, _tf_ssb_rpc_send_json_end, "send_json_end", 1));