Age | Commit message (Collapse) | Author |
|
|
|
It has not been built in a while. We do want to keep this one working (or at
least compiling).
|
|
|
|
Also, no longer #include the group code into tox.c. Instead, compile it
separately in tox_group.c. This is a bit less surprising to someone looking
around the code. Having some implementations in a .h file is certainly a bit
surprising to a disciplined C programmer, especially when there is no technical
reason to do it.
|
|
|
|
These are now generated by apidsl.
|
|
These functions simply return the constants. They are a stable ABI, so that if
constants change, the ABI of these functions won't. Code solely relying on these
functions will remain compatible with future values of those constants.
The functions are currently not exposed in tox.h, because this is pending a
change in apidsl to generate accessors for "const" values.
|
|
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
|
|
|
|
OS X and Windows have small thread stacks by default. Allocating audio and video
frames (about 962KB total) on the stack overflows it.
|
|
The condition is a potential use after free, because `connection_kill` before it
will delete the `conn` that is dereferenced.
|
|
Once every new moon, the assoc_test would fail because the key is 0. It
can be anything but 0 to succeed, so I made it 1.
|
|
10x timeouts forces travis to kill our build without offering anything helpful
|
|
|
|
uint is not a valid type on Windows. It's also not a valid type in C, but Linux
and OSX define it somewhere. We can't rely on its existence.
|
|
|
|
|
|
The threading networking functions (on windows: winsock and friends) need to be
linked into the toxnetwork library, not the toxcore library, anymore. On Linux
and OSX, there is no winsock. On OSX, there is no need to link against threading
libraries, and on Linux, toxnetwork can have unresolved symbols when linking, so
this failure wasn't caught before.
Tested by building on the iphydf/windows-x86-qt5 docker image.
|
|
|
|
|
|
|
|
|
|
This is easier to use from a precommit hook, so it can be used to ensure that
all formatting is correct before committing code.
|
|
Moved a few #defines to the top of the header for better readability
|
|
The expression was fun(foo = bar, foo). The evaluation order is unspecified,
and often this will do the wrong thing. We should forbid side effects in
argument lists and conditionals.
|
|
See #40 for details.
|
|
|
|
This behaviour is consistent with free() and operator delete.
|
|
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.
|
|
If libsodium can't be found with PKG_CHECK_MODULES, try AC_CHECK_LIB. If that
also fails, abort configure. If a user passes --with-libsodium-libs explicitly,
that overrides the pkg-config found location.
|
|
|
|
**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.
|
|
This allows us to more clearly define interfaces between modules, and have the
linker help us ensure that module boundaries are respected.
The onion/tcp/net_crypto layer is a bit too large. This is due to a cyclic
dependency (onion -> net_crypto -> TCP -> onion). We may or may not want to
break that cycle in the future to allow the onion library to exist on its own
without net_crypto.
|
|
|
|
|
|
|
|
|
|
Also, fix the hstox build that was taking half an hour. It now takes 5 minutes.
Also, perform distcheck on travis to ensure that make dist works. It's not
actually failing the build at the moment due to broken tests.
|
|
We run astyle on Travis and check if there is a diff. The build terminates if
git finds a difference.
|
|
|
|
This is in preparation for having multiple types of build. One of the future
builds will be a hstox build, another may be frama-c or some other static
analyser. It makes sense to split these up into multiple builds, because each of
them can take a while, and running them in parallel will speed things up. Also,
the hstox test coverage should be reported separately from the toxcore auto_test
coverage.
|
|
> increased the timeout for TCP tests because per @irungentoo the network on Travis-CI can be slow sometimes
> allowed groupchats test to restart on error until timeout This had to be done because current groupchats are fundamentally broken and 3/5 times they'll 'net-split' on connect
>> Drop group chat tests, add comment to the reason
> added some debugging information to TCP tests, and a #define to force IPV6 (Travis-CI only uses IPv4 on their containers) and decreased the itr interval
> Went crazy with timeouts for Tox network stuff on Travis. Tests on TCP will still randomly fail due to timeouts. I can't reproduce on any local system. So again per @irungentoo, Travis is slow, let's offer it a short bus.
|
|
sodium_init returns 1 when the library was already initialised. Toxcore code
wasn't prepared to handle sodium errors, so it thought it was an allocation
error.
This error is still not handled correctly. If crypto fails to initialise, it
will think it's an allocation error. Fixing this requires too many code changes,
so must be done later.
|
|
Some of these (like the incompatible pointers one) are really annoying for
later refactoring.
|
|
|
|
|
|
|
|
Requested, suggested
|
|
|