diff options
author | irungentoo <irungentoo@gmail.com> | 2015-07-03 21:52:53 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-07-03 21:52:53 -0400 |
commit | c259250abb86a01ae7e3fc906380417427f38ca1 (patch) | |
tree | 8516f1faa3360ffd98cbb2c55e8ad2ffabdfda5c /toxcore | |
parent | 750201c901697c4c3c44baf2a51c913e990040d6 (diff) |
Fixed Tox reporting itself as being connected with TCP when using UDP only on LAN.
Diffstat (limited to 'toxcore')
-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); |