summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-01Increase connection delay to 4 secondssin
2014-12-01Do the datasave() as early as possible in shutdown()sin
2014-12-01Save data file on receipt of a deadly signalsin
2014-12-01Update TODOsin
2014-11-30Update list of nodessin
2014-11-30Connect to nodes in a random order to minimize load on any given nodesin
2014-11-30Update TODOsin
2014-11-29Adapt to latest cleanup in APIFRIGN
2014-11-28Fix stylesin
2014-11-27Don't lock up on blocking call_outFRIGN
Since the av-refactor, we keep a call active as long as there is a listener or a sender. In case we don't have a listener, don't lock up in the sending function and rather just fall-through in case the write blocks. We can't do that as easily with the file-data-code, because data- integrity is very important there.
2014-11-26Fit ratox to new toxav-APIFRIGN
mannol has done a great job re-working the toxav-api[0] also based on our suggestions for a stricter callback-approach. Previously, toxav-callbacks could hit any time, leaving us with dramatic timing-issues and instability in certain situations. The new toxav_do()-call enables the client to control when to fire the callbacks. toxav_do_interval() makes sure no time is lost in the meantime. [0]: https://github.com/irungentoo/toxcore/pull/1163
2014-11-01Don't assume mono-audio in defaultsFRIGN
2014-10-24Use (none, pending, active) instead of (0, 1, 2)sin
2014-10-24Rename .ratox.data to .ratox.tox to comply with STSsin
https://github.com/Tox/Tox-STS/blob/master/STS.md
2014-10-23Add double spacing between sections in READMEsin
2014-10-23Add screencasting examplesin
2014-10-23Add an examples section in the READMEsin
2014-10-18Refactor logic in main-loop for pending calls even moreFRIGN
and implement fifoopen in other places.
2014-10-18Don't forget to queue call_out while incoming ringingFRIGN
Else the call would be rejected immediately in case you receive a call and have not yet opened call_out for reading.
2014-10-17Indentation fixessin
2014-10-17Refactor call-state managementFRIGN
Checking call_out only and stopping the call as soon as call_out is gone is not desirable behaviour. It now keeps up the running call until both call_out and call_in have been "closed", no matter how or by whom it was started. This is done by introducing av.state, which is a bit field. While at it, I also incorporated the transmission-state into it. toxav_hangup() will now only be called from the one centralized flag-checking-loop before select, not in the callbacks themselves. This will also get rid of some race-conditions (more or less). Previously, call_out was constantly polled as long as the user was online. Change this to only attempt to open call_out when the call is initialized. This lowers CPU-usage dramatically.
2014-10-16Remove ugly use of O_DIRECTORYsin
Oops kfreebsd builds break. Aw well.
2014-10-16CleanupFRIGN
AV-logging, logic and check for < 0 instead of == -1 (just to make sure).
2014-10-15Remember to cool down the transfer for pending buffers as wellsin
This change halves CPU usage on my system.
2014-10-15Only complain if errno is not EWOULDBLOCKsin
2014-10-15Only call toxav_kill_transmission() after toxav_prepare_transmission()sin
toxav_prepare_transmission() sets the internal toxav `call_active' state variable. This is checked in toxav_kill_transmission() and only if set, proceeds to release the resources.
2014-10-15Update READMEsin
2014-10-15Build with -g so users can provide meaningful backtracessin
2014-10-15Fortify and optimize file-sendingFRIGN
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.
2014-10-14Change the state-filesFRIGN
rename file_pending to file_state rename call_pending to call_state 0 = no call 1 = call pending 2 = call active
2014-10-13Only send call-data when Tx transmission is readyFRIGN
Due to a bug in toxcore the call is set to active too early, leaving room for invocations of sendfriendcalldata() even though the transmission has not yet been set up in cbcallstart. Fix this with a small workaround keeping the transmission-state in the client. In the long run, this definitely needs to be fixed in toxcore for consistency.
2014-10-13Fortify error-checks and FSMFRIGN
Basically the direct calls to cancelcall() should be minimized and only set off in a callback. Additionally, tweak other error-cases and don't always quit fatally but instead provide ways to get out of an error-condition.
2014-10-13Finish cleaning up av-callbacksFRIGN
Now it's fun again to work with the code.
2014-10-12Further simplify call-start-callbacksFRIGN
using the udata-void pointers to pass data as a source of information.
2014-10-12Use (void *userdata) in callbacks and drop ringing-callbackFRIGN
This saves a lot of LOC and is definitely easier to maintain.
2014-10-12Fix vertical spacingsin
2014-10-12We might eventually have logerr() and logwarn()sin
2014-10-12tox_is_data_encrypted() was renamed to tox_is_save_encrypted()sin
2014-10-12Add stricter error-checkingFRIGN
In upcoming commits, these errors will be incorporated into the logging-system, so they don't look so out of place when issued.
2014-10-10Add link to patch in README for building on OSXsin
2014-10-10Don't spin on request/out/<ID> if we echo anything other than '0' or '1'sin
2014-10-09Add kytv to LICENSE for contributing the manpagesin
2014-10-09Add nospam/ to manpagesin
2014-10-09Use NSIG instead of _NSIGsin
2014-10-09Fix request- and friend-managementFRIGN
When you got a request, but not accepted it via request/out/... and instead sent a request yourself, it would not remove the FIFO. This patch fixes this behaviour by iterating through the request- list and removing the FIFO if it's still existing. Additionally, actually make it possible to reject requests and re-add your friends later by managing the internal tox-state properly.
2014-10-08Style fixsin
Similar style as for detecting broken file transfers.
2014-10-08Don't close a random fdsin
if (f->rxstate == TRANSFER_INPROGRESS && (fd = openat(f->dirfd, ffiles[FFILE_OUT].name, ffiles[FFILE_OUT].flags, 0666)) == -1 && errno == ENXIO) { ... } else { close(fd); <--- not always appropriate! }
2014-10-08Do a toxav_hangup() like we do elsewheresin
This will trigger the callback and reset toxav internal states accordingly. In the callback we actually call cancelcall().
2014-10-08Fix file-transferssin
2014-10-08Check outfiles if they are still openFRIGN
If not, abort receiving.