From 8adb34e6a9af2fcc48dca995a644bfff1374c283 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Sat, 28 Sep 2013 17:19:32 -0400 Subject: [PATCH] Fixed possible bug. --- toxcore/Messenger.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 6728231d..c8d69494 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -1222,14 +1222,14 @@ void doFriends(Messenger *m) set_friend_status(m, i, FRIEND_CONFIRMED); } - break; - } + if (m->friendlist[i].ping_lastrecv + FRIEND_CONNECTION_TIMEOUT < temp_time) { + /* If we stopped recieving ping packets, kill it. */ + crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); + m->friendlist[i].crypt_connection_id = -1; + set_friend_status(m, i, FRIEND_CONFIRMED); + } - if (m->friendlist[i].ping_lastrecv + FRIEND_CONNECTION_TIMEOUT < temp_time) { - /* If we stopped recieving ping packets, kill it. */ - crypto_kill(m->net_crypto, m->friendlist[i].crypt_connection_id); - m->friendlist[i].crypt_connection_id = -1; - set_friend_status(m, i, FRIEND_CONFIRMED); + break; } } }