From 815725ab843618e1008819fe1449d8473627a114 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 19 May 2015 19:55:43 -0400 Subject: Some fixes. --- auto_tests/tox_test.c | 2 +- toxcore/friend_connection.c | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/auto_tests/tox_test.c b/auto_tests/tox_test.c index 52c21f48..142a178f 100644 --- a/auto_tests/tox_test.c +++ b/auto_tests/tox_test.c @@ -1186,7 +1186,7 @@ Suite *tox_suite(void) DEFTESTCASE(one); DEFTESTCASE_SLOW(few_clients, 50); DEFTESTCASE_SLOW(many_clients, 150); - DEFTESTCASE_SLOW(many_clients_tcp, 150); + DEFTESTCASE_SLOW(many_clients_tcp, 20); DEFTESTCASE_SLOW(many_clients_tcp_b, 20); DEFTESTCASE_SLOW(many_group, 100); return s; diff --git a/toxcore/friend_connection.c b/toxcore/friend_connection.c index 7dd8e3e3..1656def0 100644 --- a/toxcore/friend_connection.c +++ b/toxcore/friend_connection.c @@ -158,17 +158,12 @@ int friend_add_tcp_relay(Friend_Connections *fr_c, int friendcon_id, IP_Port ip_ if (!friend_con) return -1; - /* Local ip means that they are hosting a TCP relay. */ - if (Local_ip(ip_port.ip)) { + /* Local ip and same pk means that they are hosting a TCP relay. */ + if (Local_ip(ip_port.ip) && memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { if (friend_con->dht_ip_port.ip.family != 0) { ip_port.ip = friend_con->dht_ip_port.ip; } else { - if (memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { - friend_con->hosting_tcp_relay = 0; - return 0; - } else { - return -1; - } + friend_con->hosting_tcp_relay = 0; } } -- cgit v1.2.3