mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Some fixes.
This commit is contained in:
parent
1919292024
commit
815725ab84
|
@ -1186,7 +1186,7 @@ Suite *tox_suite(void)
|
||||||
DEFTESTCASE(one);
|
DEFTESTCASE(one);
|
||||||
DEFTESTCASE_SLOW(few_clients, 50);
|
DEFTESTCASE_SLOW(few_clients, 50);
|
||||||
DEFTESTCASE_SLOW(many_clients, 150);
|
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_clients_tcp_b, 20);
|
||||||
DEFTESTCASE_SLOW(many_group, 100);
|
DEFTESTCASE_SLOW(many_group, 100);
|
||||||
return s;
|
return s;
|
||||||
|
|
|
@ -158,17 +158,12 @@ int friend_add_tcp_relay(Friend_Connections *fr_c, int friendcon_id, IP_Port ip_
|
||||||
if (!friend_con)
|
if (!friend_con)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* Local ip means that they are hosting a TCP relay. */
|
/* Local ip and same pk means that they are hosting a TCP relay. */
|
||||||
if (Local_ip(ip_port.ip)) {
|
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) {
|
if (friend_con->dht_ip_port.ip.family != 0) {
|
||||||
ip_port.ip = friend_con->dht_ip_port.ip;
|
ip_port.ip = friend_con->dht_ip_port.ip;
|
||||||
} else {
|
} else {
|
||||||
if (memcmp(friend_con->dht_temp_pk, public_key, crypto_box_PUBLICKEYBYTES) == 0) {
|
friend_con->hosting_tcp_relay = 0;
|
||||||
friend_con->hosting_tcp_relay = 0;
|
|
||||||
return 0;
|
|
||||||
} else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user