diff options
Diffstat (limited to 'toxcore/onion_client.c')
-rw-r--r-- | toxcore/onion_client.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 4f049fbc..8609c6b6 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c | |||
@@ -1452,12 +1452,15 @@ void do_onion_client(Onion_Client *onion_c) | |||
1452 | } | 1452 | } |
1453 | } | 1453 | } |
1454 | 1454 | ||
1455 | onion_c->UDP_connected = DHT_non_lan_connected(onion_c->dht); | 1455 | _Bool UDP_connected = DHT_non_lan_connected(onion_c->dht); |
1456 | 1456 | ||
1457 | if (is_timeout(onion_c->first_run, ONION_CONNECTION_SECONDS)) { | 1457 | if (is_timeout(onion_c->first_run, ONION_CONNECTION_SECONDS)) { |
1458 | set_tcp_onion_status(onion_c->c->tcp_c, !onion_c->UDP_connected); | 1458 | set_tcp_onion_status(onion_c->c->tcp_c, !UDP_connected); |
1459 | } | 1459 | } |
1460 | 1460 | ||
1461 | onion_c->UDP_connected = UDP_connected | ||
1462 | || get_random_tcp_onion_conn_number(onion_c->c->tcp_c) == -1; /* Check if connected to any TCP relays. */ | ||
1463 | |||
1461 | if (onion_connection_status(onion_c)) { | 1464 | if (onion_connection_status(onion_c)) { |
1462 | for (i = 0; i < onion_c->num_friends; ++i) { | 1465 | for (i = 0; i < onion_c->num_friends; ++i) { |
1463 | do_friend(onion_c, i); | 1466 | do_friend(onion_c, i); |