diff --git a/core/ssb.js b/core/ssb.js index c40272d96..753364eb8 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 4ba6fafed..682dde326 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 25a6aca04..d5c9cabd7 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));