summaryrefslogtreecommitdiff
path: root/nodegen
diff options
context:
space:
mode:
authorFRIGN <dev@frign.de>2014-10-14 18:48:22 +0200
committersin <sin@2f30.org>2014-10-15 09:49:50 +0100
commit11ddb1aacdf44d8517480a030db425181952b777 (patch)
treed3e96776593071cbf916ca849d1d87ed4392987c /nodegen
parent9e1d2b5522bfb88474570ffebd6546f2d4bf445f (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 'nodegen')
0 files changed, 0 insertions, 0 deletions