From 1d583fa1118edeff48b5461a855b9d32c6aa0cb0 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Fri, 27 Mar 2015 21:49:11 -0400 Subject: [PATCH] Fixed file transfer bug. This should have been at the beginning of the loop, not the end. --- toxcore/Messenger.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toxcore/Messenger.c b/toxcore/Messenger.c index 57ec652cd..400782aa7 100644 --- a/toxcore/Messenger.c +++ b/toxcore/Messenger.c @@ -1464,6 +1464,11 @@ static void do_reqchunk_filecb(Messenger *m, int32_t friendnumber) } while (ft->status == FILESTATUS_TRANSFERRING && (ft->paused == FILE_PAUSE_NOT)) { + if (max_speed_reached(m->net_crypto, friend_connection_crypt_connection_id(m->fr_c, + m->friendlist[friendnumber].friendcon_id))) { + free_slots = 0; + } + if (free_slots == 0) break; @@ -1492,10 +1497,6 @@ static void do_reqchunk_filecb(Messenger *m, int32_t friendnumber) --free_slots; - if (max_speed_reached(m->net_crypto, friend_connection_crypt_connection_id(m->fr_c, - m->friendlist[friendnumber].friendcon_id))) { - free_slots = 0; - } } if (num == 0)