Slight cleanup.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3921 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
fe5a6033ef
commit
fb3ad0d95d
@ -188,7 +188,6 @@ ssb.addRpc(['blobs', 'get'], function(request) {
|
|||||||
}
|
}
|
||||||
request.send_json_end(true);
|
request.send_json_end(true);
|
||||||
}
|
}
|
||||||
request.more(function(request) {});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ssb.addRpc(['gossip', 'ping'], function(request) {
|
ssb.addRpc(['gossip', 'ping'], function(request) {
|
||||||
|
@ -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))
|
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;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1116,7 +1116,7 @@ static void _tf_ssb_connection_rpc_recv(tf_ssb_connection_t* connection, uint8_t
|
|||||||
{
|
{
|
||||||
if (callback)
|
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
|
else
|
||||||
|
@ -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, "flags", JS_NewUint32(context, flags));
|
||||||
JS_SetPropertyStr(context, object, "request_number", JS_NewInt32(context, request_number));
|
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, "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_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_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));
|
JS_SetPropertyStr(context, object, "send_json_end", JS_NewCFunction(context, _tf_ssb_rpc_send_json_end, "send_json_end", 1));
|
||||||
|
Loading…
Reference in New Issue
Block a user