forked from cory/tildefriends
ssb: Beginnings of a "sync now" mode for mobile.
This commit is contained in:
@ -245,7 +245,7 @@ void tf_ssb_test_ssb(const tf_test_options_t* options)
|
||||
|
||||
uint8_t id0bin[k_id_bin_len];
|
||||
tf_ssb_id_str_to_bin(id0bin, id0);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin, 0);
|
||||
|
||||
tf_printf("Waiting for connection.\n");
|
||||
while (test.connection_count0 != 1 || test.connection_count1 != 1)
|
||||
@ -457,8 +457,8 @@ void tf_ssb_test_rooms(const tf_test_options_t* options)
|
||||
|
||||
uint8_t id0bin[k_id_bin_len];
|
||||
tf_ssb_id_str_to_bin(id0bin, id0);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb2, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin, 0);
|
||||
tf_ssb_connect(ssb2, "127.0.0.1", 12347, id0bin, 0);
|
||||
|
||||
tf_printf("Waiting for connection.\n");
|
||||
while (test.connection_count0 != 2 || test.connection_count1 != 1 || test.connection_count2 != 1)
|
||||
@ -497,7 +497,7 @@ void tf_ssb_test_rooms(const tf_test_options_t* options)
|
||||
tf_ssb_connection_rpc_send_json(connections[0], k_ssb_rpc_flag_stream | k_ssb_rpc_flag_new_request, tunnel_request_number, "tunnel.connect", message, NULL, NULL, NULL);
|
||||
JS_FreeValue(context, message);
|
||||
|
||||
tf_ssb_connection_t* tun0 = tf_ssb_connection_tunnel_create(ssb1, id0, tunnel_request_number, id2);
|
||||
tf_ssb_connection_t* tun0 = tf_ssb_connection_tunnel_create(ssb1, id0, tunnel_request_number, id2, 0);
|
||||
tf_printf("tun0 = %p\n", tun0);
|
||||
|
||||
tf_printf("Done.\n");
|
||||
@ -523,9 +523,9 @@ void tf_ssb_test_rooms(const tf_test_options_t* options)
|
||||
tf_ssb_send_close(ssb1);
|
||||
tf_ssb_send_close(ssb2);
|
||||
|
||||
tf_ssb_close_all(ssb0);
|
||||
tf_ssb_close_all(ssb1);
|
||||
tf_ssb_close_all(ssb2);
|
||||
tf_ssb_close_all(ssb0, "end of test");
|
||||
tf_ssb_close_all(ssb1, "end of test");
|
||||
tf_ssb_close_all(ssb2, "end of test");
|
||||
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
|
||||
@ -689,7 +689,7 @@ void tf_ssb_test_bench(const tf_test_options_t* options)
|
||||
tf_ssb_register(tf_ssb_get_context(ssb1), ssb1);
|
||||
|
||||
tf_ssb_server_open(ssb0, 12347);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin, 0);
|
||||
|
||||
tf_printf("Waiting for messages.\n");
|
||||
clock_gettime(CLOCK_REALTIME, &start_time);
|
||||
@ -824,7 +824,7 @@ static void _ssb_test_room_broadcasts_visit(
|
||||
JS_FreeValue(context, message);
|
||||
|
||||
tf_printf("tunnel create ssb=%p portal=%s rn=%d target=%s\n", ssb, portal, (int)tunnel_request_number, target);
|
||||
tf_ssb_connection_tunnel_create(ssb, portal, tunnel_request_number, target);
|
||||
tf_ssb_connection_tunnel_create(ssb, portal, tunnel_request_number, target, 0);
|
||||
_break_in_a_bit(ssb, tunnel, target, tunnel_request_number);
|
||||
}
|
||||
}
|
||||
@ -858,8 +858,8 @@ void tf_ssb_test_go_ssb_room(const tf_test_options_t* options)
|
||||
|
||||
tf_ssb_add_broadcasts_changed_callback(ssb0, _ssb_test_room_broadcasts_changed, NULL, NULL);
|
||||
|
||||
tf_ssb_connect_str(ssb0, "net:linode.unprompted.com:8008~shs:Q0pc/7kXQJGIlqJxuwayL2huayzddgkVDoGkYVWQS1Y=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=");
|
||||
tf_ssb_connect_str(ssb1, "net:linode.unprompted.com:8008~shs:Q0pc/7kXQJGIlqJxuwayL2huayzddgkVDoGkYVWQS1Y=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=");
|
||||
tf_ssb_connect_str(ssb0, "net:linode.unprompted.com:8008~shs:Q0pc/7kXQJGIlqJxuwayL2huayzddgkVDoGkYVWQS1Y=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=", 0);
|
||||
tf_ssb_connect_str(ssb1, "net:linode.unprompted.com:8008~shs:Q0pc/7kXQJGIlqJxuwayL2huayzddgkVDoGkYVWQS1Y=:SSB+Room+PSK3TLYC2T86EHQCUHBUHASCASE18JBV24=", 0);
|
||||
|
||||
uv_run(&loop, UV_RUN_DEFAULT);
|
||||
|
||||
@ -959,8 +959,8 @@ void tf_ssb_test_peer_exchange(const tf_test_options_t* options)
|
||||
tf_ssb_whoami(ssb0, id0, sizeof(id0));
|
||||
uint8_t id0bin[k_id_bin_len];
|
||||
tf_ssb_id_str_to_bin(id0bin, id0);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb2, "127.0.0.1", 12347, id0bin);
|
||||
tf_ssb_connect(ssb1, "127.0.0.1", 12347, id0bin, 0);
|
||||
tf_ssb_connect(ssb2, "127.0.0.1", 12347, id0bin, 0);
|
||||
|
||||
while (_count_broadcasts(ssb0) != 2 || _count_broadcasts(ssb1) != 1 || _count_broadcasts(ssb2) != 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user