mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Only set last_to_ping if at least one node was pinged,
This commit is contained in:
parent
3d70fe126c
commit
6a4c2e8fc6
|
@ -304,16 +304,18 @@ void do_to_ping(PING *ping)
|
||||||
if (!ip_isset(&ping->to_ping[0].ip_port.ip))
|
if (!ip_isset(&ping->to_ping[0].ip_port.ip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ping->last_to_ping = unix_time();
|
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
for (i = 0; i < MAX_TO_PING; ++i) {
|
for (i = 0; i < MAX_TO_PING; ++i) {
|
||||||
if (!ip_isset(&ping->to_ping[i].ip_port.ip))
|
if (!ip_isset(&ping->to_ping[i].ip_port.ip))
|
||||||
return;
|
break;
|
||||||
|
|
||||||
send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key);
|
send_ping_request(ping, ping->to_ping[i].ip_port, ping->to_ping[i].public_key);
|
||||||
ip_reset(&ping->to_ping[i].ip_port.ip);
|
ip_reset(&ping->to_ping[i].ip_port.ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (i != 0)
|
||||||
|
ping->last_to_ping = unix_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user