summaryrefslogtreecommitdiff
path: root/toxcore
AgeCommit message (Collapse)Author
2016-09-01Match parameter names in declarations with their definitions.iphydf
The parameter names were taken from function definitions to update the names in function declarations (prototypes).
2016-08-31Remove redundant `return` statements.iphydf
2016-08-31Add newlines because astyle wants them.iphydf
We'll revert this once we move to clang-format.
2016-08-31Add braces to all if statements.iphydf
2016-08-30Add missing #includes to headers and rename tox_old to tox_group.iphydf
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.
2016-08-29Add getters/setters for options.iphydf
2016-08-29Update tox.h with constant functions.iphydf
These are now generated by apidsl.
2016-08-28Expose constants as functions.iphydf
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.
2016-08-27Move logging to a callback.iphydf
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.
2016-08-26Comment out useless TODO'd if block.iphydf
The condition is a potential use after free, because `connection_kill` before it will delete the `conn` that is dereferenced.
2016-08-22Replace uint with unsigned int in assoc.c.iphydf
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.
2016-08-22Make Message received receipts statelessGregory Mullen (grayhatter)
2016-08-22Make Friend User Status statelessGregory Mullen (grayhatter)
2016-08-20Make the friend message callback statelessGregory Mullen (grayhatter)
2016-08-19Make Typing change callback statelessGregory Mullen (grayhatter)
Moved a few #defines to the top of the header for better readability
2016-08-18Make friend_status_message callback stateless.iphydf
See #40 for details.
2016-08-18Fix some compiler warnings.iphydf
2016-08-18Allow NULL as argument to tox_kill.iphydf
This behaviour is consistent with free() and operator delete.
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2016-08-17Add missing DHT_bootstrap to CMakeLists.txt.iphydf
- 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.
2016-08-17Make self_connection_status callback stateless.iphydf
**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.
2016-08-12Check code formatting on Travis.iphydf
We run astyle on Travis and check if there is a diff. The build terminates if git finds a difference.
2016-08-11Fix a bug I introduced that would make toxcore fail to initialise a second time.iphydf
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.
2016-08-10Silence/fix some compiler warnings.iphydf
Some of these (like the incompatible pointers one) are really annoying for later refactoring.
2016-03-19Merge branch 'network-test-magic' of https://github.com/roman-yepishev/toxcoreirungentoo
2016-02-27Move argument comments to the end of lineRoman Yepishev
2016-02-27Remove magic numbers from addr_resolveRoman Yepishev
* Add #defines for INET/INET6 returns * Remove magic number 3 - exact AF_INET/INET6 result found. * Updated network_test.c
2016-02-26Add missing files so that archive for make dist is completeRoman Yepishev
2016-02-13added the dropped ;Gregory Mullen (GrayHatter)
2016-02-13update the compatablity function to match the macroGregory Mullen (GrayHatter)
2016-02-13Get SemVer more readyGregory Mullen (GrayHatter)
2016-01-30Fixes.irungentoo
Fixed bug from merged PR. Don't build useless files when building with libsodium.
2016-01-27 fix: replace memset with sodium_memzero for sensitive dataRoman Proskuryakov
2016-01-27 add: more comments into network.cRoman Proskuryakov
2016-01-27 add: comments about hairy codeRoman Proskuryakov
2016-01-27 add: comment about endiannessRoman Proskuryakov
2016-01-27 fix: compare sensitive data with sodium_memcmpRoman Proskuryakov
fix: make increment_nonce & increment_nonce_number independent of user-controlled input fix: make crypto_core more stable agains null ptr dereference
2016-01-04Cleanups.irungentoo
2016-01-04DHT improvements part 1.irungentoo
2015-12-17Fixed possible bug.irungentoo
2015-12-17Allow 0 length sendnode.irungentoo
2015-12-16Send get nodes instead of ping to timing out nodes.irungentoo
2015-12-16This is still useful.irungentoo
2015-12-16Slightly increase ping timeout.irungentoo
2015-12-16Less packet spam.irungentoo
2015-12-16Improved the to_ping list.irungentoo
2015-12-15More efficient DHT searching.irungentoo
2015-12-14Sort list if timed out nodes are in the middle of the list.irungentoo
2015-12-14Send get nodes more to closer nodes than further nodes.irungentoo
2015-12-12Small onion search improvement.irungentoo