Cleans up some confusing output from -t ssb.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3660 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2021-09-06 21:21:51 +00:00
parent e85168ac53
commit 91ec68252d
2 changed files with 9 additions and 1 deletions

View File

@ -13,7 +13,6 @@ ssb.registerConnectionsChanged(function(change, connection) {
var out_message = {};
out_message[id] = blob.byteLength;
g_wants_requests[connection.id].send_json(out_message);
//connection.wants_request.send_json(out_message);
}
} else {
debug_print("blobs.get", id);

View File

@ -582,6 +582,9 @@ static void _tf_ssb_connection_verify_identity(tf_ssb_connection_t* connection,
char fullid[k_id_base64_len];
tf_ssb_id_bin_to_str(fullid, sizeof(fullid), connection->serverpub);
JSContext* context = connection->ssb->context;
JS_SetPropertyStr(context, connection->object, "id", JS_NewString(context, fullid));
connection->state = k_tf_ssb_state_verified;
for (int i = 0; i < connection->ssb->connections_changed_count; i++) {
connection->ssb->connections_changed[i](connection->ssb, k_tf_ssb_change_connect, connection, connection->ssb->connections_changed_user_data[i]);
@ -767,6 +770,12 @@ static void _tf_ssb_connection_verify_client_identity(tf_ssb_connection_t* conne
static_assert(sizeof(c) == 80, "server send size");
_tf_ssb_write(connection, c, sizeof(c));
char fullid[k_id_base64_len];
tf_ssb_id_bin_to_str(fullid, sizeof(fullid), connection->serverpub);
JSContext* context = connection->ssb->context;
JS_SetPropertyStr(context, connection->object, "id", JS_NewString(context, fullid));
connection->state = k_tf_ssb_state_server_verified;
for (int i = 0; i < connection->ssb->connections_changed_count; i++) {
connection->ssb->connections_changed[i](connection->ssb, k_tf_ssb_change_connect, connection, connection->ssb->connections_changed_user_data[i]);