From 543682066d4cf6ffad3ad9f2e41f200a2c2fdcd7 Mon Sep 17 00:00:00 2001 From: sin Date: Tue, 16 Sep 2014 13:18:39 +0100 Subject: Correctly inform the user when the transfer is complete --- ratatox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ratatox.c b/ratatox.c index f1dc5e0..50e9e6f 100644 --- a/ratatox.c +++ b/ratatox.c @@ -379,7 +379,6 @@ cb_file_control(Tox *m, int32_t fid, uint8_t rec_sen, uint8_t fnum, uint8_t ctrl if (f->fid != fid) continue; f->t.state = TRANSFER_DONE; - printout("Transfer complete\n"); break; } } @@ -414,7 +413,6 @@ again: return; } f->t.n = n; - /* relax - allow for tox_do() to do its job */ if (tox_file_send_data(tox, f->fid, f->t.fnum, f->t.buf, f->t.n) == -1) { /* remember to resend the last buffer */ f->t.pending = 1; @@ -924,8 +922,10 @@ loop(void) switch (f->t.state) { case TRANSFER_INPROGRESS: send_friend_file(f); - if (f->t.state == TRANSFER_DONE) + if (f->t.state == TRANSFER_DONE) { + printout("Transfer complete\n"); f->t.state = TRANSFER_NONE; + } break; } } @@ -954,8 +954,10 @@ loop(void) break; case TRANSFER_INPROGRESS: send_friend_file(f); - if (f->t.state == TRANSFER_DONE) + if (f->t.state == TRANSFER_DONE) { + printout("Transfer complete\n"); f->t.state = TRANSFER_NONE; + } break; } break; -- cgit v1.2.3