1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 03:36:45 +02:00

put file senders in a round-robin queue so multiple transfers upload at a uniform pace

This commit is contained in:
Jfreegman
2014-07-27 21:19:17 -04:00
parent 02708534c0
commit b18a67d656
4 changed files with 54 additions and 32 deletions

View File

@ -423,7 +423,7 @@ static void chat_onFileData(ToxWindow *self, Tox *m, int32_t num, uint8_t filenu
if (!remain || timed_out(friends[num].file_receiver.last_progress[filenum], curtime, 1)) {
friends[num].file_receiver.last_progress[filenum] = curtime;
uint64_t size = friends[num].file_receiver.size[filenum];
double pct_remain = remain ? (1 - (remain / size)) * 100 : 100;
double pct_remain = remain > 0 ? (1 - (remain / size)) * 100 : 100;
print_progress_bar(self, filenum, num, pct_remain);
friends[num].file_receiver.bps[filenum] = 0;
}