mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed Tox reporting itself as being connected with TCP when using UDP only on LAN.
This commit is contained in:
parent
750201c901
commit
c259250abb
|
@ -281,6 +281,8 @@ void tox_connection_status(Tox *tox, TOX_CONNECTION connection_status, void *use
|
|||
if (connected_t1 && !connection_status)
|
||||
ck_abort_msg("Tox went offline");
|
||||
|
||||
ck_assert_msg(connection_status == TOX_CONNECTION_UDP, "wrong status %u", connection_status);
|
||||
|
||||
connected_t1 = connection_status;
|
||||
}
|
||||
|
||||
|
|
|
@ -1452,12 +1452,15 @@ void do_onion_client(Onion_Client *onion_c)
|
|||
}
|
||||
}
|
||||
|
||||
onion_c->UDP_connected = DHT_non_lan_connected(onion_c->dht);
|
||||
_Bool UDP_connected = DHT_non_lan_connected(onion_c->dht);
|
||||
|
||||
if (is_timeout(onion_c->first_run, ONION_CONNECTION_SECONDS)) {
|
||||
set_tcp_onion_status(onion_c->c->tcp_c, !onion_c->UDP_connected);
|
||||
set_tcp_onion_status(onion_c->c->tcp_c, !UDP_connected);
|
||||
}
|
||||
|
||||
onion_c->UDP_connected = UDP_connected
|
||||
|| get_random_tcp_onion_conn_number(onion_c->c->tcp_c) == -1; /* Check if connected to any TCP relays. */
|
||||
|
||||
if (onion_connection_status(onion_c)) {
|
||||
for (i = 0; i < onion_c->num_friends; ++i) {
|
||||
do_friend(onion_c, i);
|
||||
|
|
Loading…
Reference in New Issue
Block a user