diff options
author | FRIGN <dev@frign.de> | 2014-10-14 18:48:22 +0200 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-10-15 09:49:50 +0100 |
commit | 11ddb1aacdf44d8517480a030db425181952b777 (patch) | |
tree | d3e96776593071cbf916ca849d1d87ed4392987c /arg.h | |
parent | 9e1d2b5522bfb88474570ffebd6546f2d4bf445f (diff) |
Fortify and optimize file-sending
Do this in two ways:
1) only allow ratox to stay in the file-sender for a certain amount
of time
2) Stop hammering tox_file_send_data(). When it returns -1, we put
the given friend into a cooldown-state, because all internal transmission
slots are full.
File sending thus now works in bursts, reading from file_in as long
as tox_do() allows or until tox_file_send_data() fails.
An easy way to see why we need to do the former is piping /dev/urandom
to file_in, which never blocks. Effectively, the user goes "offline"
after a while given he is trapped inside the loop.
Piping to /dev/urandom is not an unrealistic testcase. Imagine a
researcher who desperately needs true random data from his special
RNG in his lab using ratox and piping it through /dev/urandom.
Diffstat (limited to 'arg.h')
0 files changed, 0 insertions, 0 deletions