diff options
author | sin <sin@2f30.org> | 2014-10-15 12:36:38 +0100 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-10-15 12:37:48 +0100 |
commit | 3ed49ebb30e71a1575391dd50317e7859273de0b (patch) | |
tree | 0979e79ae4a9f8a1e1fbd78b597297badf6e64a2 /ratox.c | |
parent | 78223c1ef2ef456e85ef3c086b5a3a070a89fac3 (diff) |
Remember to cool down the transfer for pending buffers as well
This change halves CPU usage on my system.
Diffstat (limited to 'ratox.c')
-rw-r--r-- | ratox.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -925,7 +925,8 @@ sendfriendfile(struct friend *f) /* Attempt to transmit the pending buffer */ if (f->tx.pendingbuf == 1) { if (tox_file_send_data(tox, f->num, f->tx.fnum, f->tx.buf, f->tx.n) == -1) { - /* bad luck - we will try again later */ + clock_gettime(CLOCK_MONOTONIC, &f->tx.lastblock); + f->tx.cooldown = 1; break; } f->tx.pendingbuf = 0; |