summaryrefslogtreecommitdiff
path: root/toxcore
AgeCommit message (Collapse)Author
2018-07-08Rename `BS_LIST` to `BS_List` to follow the naming conventions.iphydf
`BS_LIST` would be a constant. `BS_List` is a type name.
2018-07-08Use named types for onion callbacks.iphydf
This is now a style rule: you can only use typedef'd function types. Previous rules now applied in `onion_*.c`: * `struct`s must have a name (typedef of unnamed struct is not allowed). * `++i` for increment-stmt, not `i++`, e.g. in loops. * Only a single declarator per struct member declaration. * Type_Names vs. variable_names.
2018-07-08Use named function types for friend_connection callbacks.iphydf
Also: * No inner structs. * One declarator per member declaration. * Function names are snake_case. * Names ending in `_cb` are function types. * `++i` is preferred over `i++`.
2018-07-07Call the "peer leaves" callback only once on group delete.iphydf
We used to pass the actual peer numbers of peers leaving, but we no longer know these in the PGC world, so we don't pass them anymore.
2018-07-05Make tox.c unambiguously parseable.iphydf
Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum
2018-07-01Simplify Travis CI builds.iphydf
Have one script per build. This means more duplication between the scripts, but it's much easier to understand and to run locally.
2018-06-29Add a test to try and overflow the send queue in net_crypto.iphydf
2018-06-29Correct check for net_crypto packet index.Evgeny Kurnevsky
2018-06-28Various minor cleanups in `net_crypto`.iphydf
* Consistently use `num_packets_array` to get the packet count in the packet buffer. * Use `const` in more places. * Typo fix: begginning. * Rewrite `length < 1` for unsigned int to `length == 0`. * Limit scope of some loop variables by using for-init-decl. * Use early return in error paths to reduce indentation and for clarity. * Use `net_unpack_*` instead of manual `ntohs`. * Fix an uninitialised stack variable copy. * Fix a potential null pointer dereference. * Consistently use `get_crypto_connection`. It was inlined in some places. I de-inlined it now. * Add Loggers to some functions in preparation for adding log statements.
2018-06-27Add missing MAX_HOSTNAME_LENGTH doc.cotox
2018-06-26Make arg `host` understand clearly.cotox
Rename args `host:port` from `address:port`. The *address* is well known as *Tox Address* in this project. Then we should reserve *addres* to it, and use *host* to express the hostname or IP address in TCP domain.
2018-06-25Release v0.2.3Robin Lindén
2018-06-25Add a MAX_HOSTNAME_LENGTH constant.iphydf
Fixes #946.
2018-06-24Use clang-format for C++ code.iphydf
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24Add new Circle CI configuration.iphydf
This one has ASAN enabled, unlike Travis.
2018-06-24Add Logger to various net_crypto functions.iphydf
In preparation for adding log statements. Also, fix an uninitialised variable warning in cppcheck.
2018-06-23Disable UDP when proxy is enabled.iphydf
Currently, toxcore does not support UDP over proxies. In the future, we can relax this by disabling UDP only if the proxy doesn't support it.
2018-06-23Make NULL options behave the same as default options.iphydf
I.e. make tox_new(0, 0) behave the same as tox_new(tox_options_new(0), 0). Changing defaults in the options does not currently affect NULL options.
2018-06-22Make the net_crypto connection state an enum.iphydf
It was a list of #defines, but clearly this is a discrete and limited set of named values, so an enum is more appropriate.
2018-06-17Minor cleanup: return early on error condition.iphydf
2018-06-09Sort bazel build file according to buildifier standard.iphydf
2018-06-04Log only the filename, not the full path in LOGGER.iphydf
Fixes #900.
2018-06-03Fix macOS macro because of GNU Machyangfl
2018-05-29Fix enumeration of Crypto_Connection instancesPavel Karelin
2018-05-23Fix ipport_isset: port 0 is not a valid port.iphydf
2018-05-23Fix the often call of event tox_friend_connection_statusPavel Karelin
Fixes #868 Is made by: 1. Fix enumeration mechanism of Crypto_Connection instances in function send_crypto_packets() (this item solves the main problem); 2. Disruption of correlation between parameters of different dimensions (the parameters MAX_NUM_SENDPACKET_TRIES and UDP_DIRECT_TIMEOUT have different dimensions).
2018-05-20Finish @Diadlo's network Family abstraction.iphydf
The Family stuff in toxcore is a big mess. I'm sure I saw a bunch of bugs on the way, but I'm not verifying that code now, so the bugs stay.
2018-05-20Move system header includes from network.h to network.ciphydf
2018-05-10Make toxcore compile on BSDendoffile78
2018-04-17Improve network error reporting on WindowsMaxim Biro
Windows doesn't report network errors though errno, it has its own facilities.
2018-04-18Release v0.2.2Robin Lindén
2018-04-15Restrict packet kinds that can be sent through onion path.Evgeny Kurnevsky
2018-04-03Avoid the use of rand() in tests.iphydf
We control the random functions in crypto_core, so we can make them deterministic more easily. This will help test reproducibility in the future.
2018-04-03add comment to func cryptpacket_receivedhqwrong
2018-03-17Disallow stderr logger by default.iphydf
2018-03-16Add default stderr logger for logging to nullptr.iphydf
This is useful for debugging a function that doesn't have a logger available. It should not be used in production code, since it outputs to stderr.
2018-03-16Move struct DHT_Friend into DHT.c.iphydf
2018-03-16Remove the use of the 'hh' format specifier.iphydf
It's not supported in mingw. See https://github.com/TokTok/c-toxcore/issues/786.
2018-03-16Simplify sendpacket function, deduplicate some logic.iphydf
2018-03-09Update version to 0.2.1.iphydf
2018-03-07Add missing tox_nospam_size() functionRobin Lindén
2018-03-02Make file transfers 50% faster.iphydf
By increasing a magic number.. Also, added more verbose logging to the file transfer test.
2018-02-27Remove deprecated conference namelist change callback.iphydf
2018-02-27Change default username to empty stringtox-user
Fixes #768
2018-02-25Fix warning on Mac OS X and FreeBSD.iphydf
This currently fails the nightly build.
2018-02-24Fix a bunch of compiler warnings and remove suppressions.iphydf
2018-02-24Some minor cleanups suggested by cppcheck.iphydf
DETECTED=cppcheck
2018-02-24Fix memory leak of Logger instance on error paths.iphydf
Found using the infer static analyser. https://github.com/facebook/infer DETECTED=infer
2018-02-24Minor cleanups: dead stores and avoiding complex macros.iphydf
2018-02-23Add deprecation notices to functions that will go away in v0.3.0.iphydf