diff options
-rw-r--r-- | auto_tests/tox_test.c | 2 | ||||
-rw-r--r-- | 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) | |||
1186 | DEFTESTCASE(one); | 1186 | DEFTESTCASE(one); |
1187 | DEFTESTCASE_SLOW(few_clients, 50); | 1187 | DEFTESTCASE_SLOW(few_clients, 50); |
1188 | DEFTESTCASE_SLOW(many_clients, 150); | 1188 | DEFTESTCASE_SLOW(many_clients, 150); |
1189 | DEFTESTCASE_SLOW(many_clients_tcp, 150); | 1189 | DEFTESTCASE_SLOW(many_clients_tcp, 20); |
1190 | DEFTESTCASE_SLOW(many_clients_tcp_b, 20); | 1190 | DEFTESTCASE_SLOW(many_clients_tcp_b, 20); |
1191 | DEFTESTCASE_SLOW(many_group, 100); | 1191 | DEFTESTCASE_SLOW(many_group, 100); |
1192 | return s; | 1192 | 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_ | |||
158 | if (!friend_con) | 158 | if (!friend_con) |
159 | return -1; | 159 | return -1; |
160 | 160 | ||
161 | /* Local ip means that they are hosting a TCP relay. */ | 161 | /* Local ip and same pk means that they are hosting a TCP relay. */ |
162 | if (Local_ip(ip_port.ip)) { | 162 | if (Local_ip(ip_port.ip) && memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { |
163 | if (friend_con->dht_ip_port.ip.family != 0) { | 163 | if (friend_con->dht_ip_port.ip.family != 0) { |
164 | ip_port.ip = friend_con->dht_ip_port.ip; | 164 | ip_port.ip = friend_con->dht_ip_port.ip; |
165 | } else { | 165 | } else { |
166 | if (memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) { | 166 | friend_con->hosting_tcp_relay = 0; |
167 | friend_con->hosting_tcp_relay = 0; | ||
168 | return 0; | ||
169 | } else { | ||
170 | return -1; | ||
171 | } | ||
172 | } | 167 | } |
173 | } | 168 | } |
174 | 169 | ||