mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fix bug causing API to report wrong self connection status
This commit is contained in:
parent
99d873b985
commit
c0a0a8204c
|
@ -1834,15 +1834,12 @@ void do_onion_client(Onion_Client *onion_c)
|
|||
}
|
||||
}
|
||||
|
||||
bool udp_connected = dht_non_lan_connected(onion_c->dht);
|
||||
onion_c->udp_connected = dht_non_lan_connected(onion_c->dht);
|
||||
|
||||
if (mono_time_is_timeout(onion_c->mono_time, onion_c->first_run, ONION_CONNECTION_SECONDS * 2)) {
|
||||
set_tcp_onion_status(nc_get_tcp_c(onion_c->c), !udp_connected);
|
||||
set_tcp_onion_status(nc_get_tcp_c(onion_c->c), !onion_c->udp_connected);
|
||||
}
|
||||
|
||||
onion_c->udp_connected = udp_connected
|
||||
|| get_random_tcp_onion_conn_number(nc_get_tcp_c(onion_c->c)) == -1; /* Check if connected to any TCP relays. */
|
||||
|
||||
if (onion_connection_status(onion_c)) {
|
||||
for (unsigned i = 0; i < onion_c->num_friends; ++i) {
|
||||
do_friend(onion_c, i);
|
||||
|
|
Loading…
Reference in New Issue
Block a user