From 545cc916620c8c9bff5145a216b55a26fcd62d46 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 7 Aug 2014 16:58:17 -0400 Subject: [PATCH] Increased ping interval time to decrease bandwidth usage. This should not increase the time it takes for people to find themselves. --- toxcore/onion_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toxcore/onion_client.c b/toxcore/onion_client.c index 42982ea8..96831beb 100644 --- a/toxcore/onion_client.c +++ b/toxcore/onion_client.c @@ -966,7 +966,8 @@ int onion_set_friend_online(Onion_Client *onion_c, int friend_num, uint8_t is_on } -#define ANNOUNCE_FRIEND ONION_NODE_PING_INTERVAL +#define ANNOUNCE_FRIEND (ONION_NODE_PING_INTERVAL * 3) +#define FRIEND_ONION_NODE_TIMEOUT (ONION_NODE_TIMEOUT * 3) static void do_friend(Onion_Client *onion_c, uint16_t friendnum) { @@ -981,7 +982,7 @@ static void do_friend(Onion_Client *onion_c, uint16_t friendnum) if (!onion_c->friends_list[friendnum].is_online) { for (i = 0; i < MAX_ONION_CLIENTS; ++i) { - if (is_timeout(list_nodes[i].timestamp, ONION_NODE_TIMEOUT)) + if (is_timeout(list_nodes[i].timestamp, FRIEND_ONION_NODE_TIMEOUT)) continue; ++count;