mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
auto-connect errors verbose
This commit is contained in:
parent
92029baff1
commit
0ac4f1fcb3
|
@ -252,10 +252,15 @@ static void init_windows()
|
|||
static void do_tox()
|
||||
{
|
||||
static int conn_try = 0;
|
||||
static int conn_err = 0;
|
||||
static bool dht_on = false;
|
||||
if (!dht_on && !DHT_isconnected() && !(conn_try++ % 100)) {
|
||||
init_connection();
|
||||
wprintw(prompt->window, "\nEstablishing connection...\n");
|
||||
if (!conn_err) {
|
||||
conn_err = init_connection();
|
||||
wprintw(prompt->window, "\nEstablishing connection...\n");
|
||||
if (conn_err)
|
||||
wprintw(prompt->window, "\nAuto-connect failed with error code %d\n", conn_err);
|
||||
}
|
||||
}
|
||||
else if (!dht_on && DHT_isconnected()) {
|
||||
dht_on = true;
|
||||
|
@ -264,7 +269,6 @@ static void do_tox()
|
|||
else if (dht_on && !DHT_isconnected()) {
|
||||
dht_on = false;
|
||||
wprintw(prompt->window, "\nDHT disconnected. Attempting to reconnect.\n");
|
||||
init_connection();
|
||||
}
|
||||
doMessenger(m);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user