Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Moved a few #defines to the top of the header for better readability
|
|
See #40 for details.
|
|
See #27 and #40 for details.
|
|
- This PR also adds a DEBUG cmake option that enables -DTOX_DEBUG.
- We also remove `-Wall`, because there are too many warnings, and nobody really
looks at them at the moment. We'll see about fixing them soon. We'll also want
to enable `-Werror` at some point.
- Finally, this PR enables `-O3` to make sure toxcore still works correctly
under heavy compiler optimisations.
|
|
**What are we doing?**
We are moving towards stateless callbacks. This means that when registering a
callback, you no longer pass a user data pointer. Instead, you pass a user data
pointer to tox_iterate. This pointer is threaded through the code, passed to
each callback. The callback can modify the data pointed at. An extra indirection
will be needed if the pointer itself can change.
**Why?**
Currently, callbacks are registered with a user data pointer. This means the
library has N pointers for N different callbacks. These pointers need to be
managed by the client code. Managing the lifetime of the pointee can be
difficult. In C++, it takes special effort to ensure that the lifetime of user
data extends at least beyond the lifetime of the Tox instance. For other
languages, the situation is much worse. Java and other garbage collected
languages may move objects in memory, so the pointers are not stable. Tox4j goes
through a lot of effort to make the Java/Scala user experience a pleasant one by
keeping a global array of Tox+userdata on the C++ side, and communicating via
protobufs. A Haskell FFI would have to do similarly complex tricks.
Stateless callbacks ensure that a user data pointer only needs to live during a
single function call. This means that the user code (or language runtime) can
move the data around at will, as long as it sets the new location in the
callback.
**How?**
We are doing this change one callback at a time. After each callback, we ensure
that everything still works as expected. This means the toxcore change will
require 15 Pull Requests.
|
|
fix: make increment_nonce & increment_nonce_number independent of user-controlled input
fix: make crypto_core more stable agains null ptr dereference
|
|
the docs say.
|
|
This fixes the PACKET_ID_OFFLINE handling code incorrectly falling through to the PACKET_ID_NICKNAME handling code
This bug resulted in a friend B's name being wiped on friend A's client after B removes A
Fixes tux3/qTox#1967
Fixes #1426
|
|
|
|
|
|
|
|
|
|
This might reduce the likelyness of broken saves.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Dissallow sending non requested data.
|
|
|
|
|
|
|
|
|
|
Calculate public key from it.
|
|
|
|
Removed useless code.
|
|
TODO: tell friends we are hosting a relay and prioritize using relays
hosted by friends over bootstrap ones.
|
|
|
|
|
|
A TCP callback could be received when only a UDP connection was present.
Increased a UDP timeout to make it less likely to time out and switch to TCP.
|
|
|
|
|
|
with them.
|
|
|
|
|
|
Don't allow non transferring files to be paused and then resumed
starting the file transfer.
|
|
also removed remnants of the no longer used variable ping_lastrecv
|
|
|
|
This should have been at the beginning of the loop, not the end.
|
|
|
|
other size (except streaming of course).
|
|
any file number for them in core.
These can be used to tell friends we don't have an avatar set or to unset
a set avatar.
|
|
transfers instead of 0.
For avatar transfers file size 0 now means that the client has no avatar
set.
Added a test for streaming transfers.
|
|
messaging function.
This removes code duplication and allows us to easily add new message
types to the api without having to add new functions.
|
|
offline.
|