Commit Graph

4706 Commits

Author SHA1 Message Date
iphydf
02a5bdc60c
Add logging to TCP and onion client. 2020-05-04 01:27:36 +01:00
iphydf
4efe541814
Add a script to run Travis CI locally.
This isn't quite Travis, but close enough for local testing.
2020-05-03 16:59:26 +01:00
iphydf
88b90c8225
Fix a bug in savedata loading when malloc fails.
Also added a bunch of asserts to tests where they don't check allocs.
2020-05-03 14:13:48 +00:00
iphydf
7b758f66db
Enable cimple tests by default but allow disabling them.
Use `bazel test //c-toxcore/... --build_tag_filters=-haskell` to run all
tests except the ones that depend on Haskell (i.e. cimple tests).
2020-05-03 14:03:54 +01:00
iphydf
f8ab32aaa4
Add a check that we don't have any unused functions.
This check puts all of our code in a C++ anonymous namespace, which is
effectively making all functions `static`. This allows the compiler to
determine that a function is unused, so we can delete it.
2020-05-02 22:00:09 +01:00
iphydf
2570ddcb17
Fix errors on error paths found by oomer.
* Use-after-free because we free network before dht in one case.
* Various unchecked allocs in tests (not so important).
* We used to not check whether ping arrays were actually allocated in DHT.
* `ping_kill` and `ping_array_kill` used to crash when passing NULL.

Also:
* Added an assert in all public API functions to ensure tox isn't NULL.
  The error message you get from that is a bit nicer than "Segmentation
  fault" when clients (or our tests) do things wrong.
* Decreased the sleep time in iterate_all_wait from 20ms to 5ms.
  Everything seems to still work with 5ms, and this greatly decreases
  the amount of time spent per test run, making oomer run much faster.
2020-05-02 21:47:08 +01:00
iphydf
e057bae563
Include <string.h> for explicit_bzero.
We need this for vanilla nacl builds on Linux.
2020-05-02 00:19:55 +01:00
Robin Linden
9be4dbb433
Release 0.2.12 2020-05-01 12:58:27 +02:00
iphydf
7edc0a52fe
Bound the number of friends you can have to ~4 billion.
If you have UINT32_MAX friends, then adding one more friend will cause an
overflow of the friend list (wrap to 0) and result in all friends being
deleted. This subsequently results in a null pointer dereference when
we're trying to add one friend to the deleted friend list.
2020-04-29 12:22:06 +00:00
iphydf
de3c21b5b7
Disable non-hermetic tests by default.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955319.
2020-04-29 12:09:34 +00:00
iphydf
f3c6fc6771
Add execution trace option for debugging.
Use `cmake -DEXECUTION_TRACE=ON` to use it.
2020-04-27 23:10:27 +00:00
iphydf
a2d586b782
Rework the toxchat/bootstrap-node Docker image.
* Use fully static build for the bootstrap daemon.
* Store a sha256sum of the binary in the repo.
* Updated documentation for it.
* Add support for fully static build in cmake.
* Enable the docker build on every PR, so we catch changes to the
  checksum. I realise this is adding toil, but having the checksum is
  valuable for security of released binaries.
2020-04-26 16:13:24 +00:00
iphydf
087eede3a3
Allow test coverage to fluctuate 2% up and down, but not below 80%. 2020-04-26 16:05:12 +00:00
zugz (tox)
8816e50ed7
Skip invalid TCP relays and DHT nodes when loading save data 2020-04-26 00:00:00 +00:00
iphydf
223f98d0b5
Set up release-drafter.
See https://github.com/release-drafter/release-drafter
2020-04-25 14:38:21 +00:00
iphydf
a837559862
Add CODEOWNERS and settings.yml files. 2020-04-25 03:12:12 +00:00
ImgBotApp
6ef80efbf5
[ImgBot] Optimize images
*Total -- 23.11kb -> 12.21kb (47.19%)

/other/tox.png -- 17.50kb -> 6.99kb (60.05%)
/other/tox-warning.png -- 5.61kb -> 5.21kb (7.04%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
2020-04-24 21:55:23 +00:00
iphydf
2c45d45133
Fix continuous integration builds. 2020-04-24 14:43:37 +00:00
iphydf
7c0eb5c70b
Enable TCP relay test in Bazel and autotools build.
This test was fixed by @robinlinden, but not enabled in all builds.
2020-04-20 09:28:00 +00:00
iphydf
6ebcd365c9
Invert not_valid functions and name them is_valid.
Also changed their return type to bool instead of 1/0 ints.
2020-04-19 20:17:09 +00:00
zugz (tox)
3ad953c6c3
fix saving of combination of loaded and connected TCP relays 2020-04-19 00:00:01 +00:00
zoff99
cdafc6ff5e
Add new semi-private API functions to set per-packet-id custom handlers.
This is to prepare for ToxAV becoming independent of toxcore internal calls.
2020-04-16 12:28:13 +00:00
iphydf
c08b2fb3e2
Remove tokstyle exemptions from build files.
We put some tokstyle exemptions into the source files themselves,
instead. This way we can check some of the code in those files, and more
in the future when tokstyle supports more constructs (like apidsl).

Also: hacked ping_array.api.h to not emit `_array` as parameter names.
We'll need to fix apidsl to do this better. This works for now.
2020-04-16 11:05:08 +00:00
Robin Linden
7f9f8045cd
Fix things not being initialized if creating a TCP-only network 2020-04-13 22:43:51 +02:00
iphydf
b816c6f8e3
Stop using the "inline namespace" feature of apidsl.
This adds complexity for very little value.
2020-04-09 21:33:34 +00:00
zoff99
af6e27bbf1
Use public API for sending in RTP. 2020-04-09 11:51:34 +00:00
iphydf
2a79748ed9
Give CI workflow a better name: clang-sanitizers 2020-04-08 19:02:40 +00:00
iphydf
2538905e4f
Install ci-tools and get tokstyle via the script it provides. 2020-04-08 17:56:42 +00:00
zoff99
da2c4191b4
Use public API for sending in BWC. 2020-04-08 13:41:58 +00:00
iphydf
8ddc2df662
Remove newlines from the end of LOGGER format strings.
See https://github.com/TokTok/hs-tokstyle/pull/49 for the corresponding
tokstyle analysis.
2020-04-07 19:17:58 +00:00
zoff99
dfe19e04d3
Change ToxAVCall struct mutex to a more distinct name. 2020-04-07 17:56:01 +00:00
zoff99
97fc2f4c0b
Create own instance of MonoTime for ToxAV. 2020-04-07 17:16:17 +00:00
zoff99
27f24e61b2
Stop using Messenger's mono_time in bandwidth controller.
We're actually still using it, but we got a private pointer now,
preparing us for having a private mono_time in toxav.
2020-04-05 11:56:52 +00:00
zoff99
bcbc374370
Fix 2 memory leaks in ToxAV. 2020-04-05 09:32:23 +00:00
iphydf
f0ae0511c2
Make afl_toxsave.c a bit more portable; fix memleak.
malloc.h doesn't exist on most platforms, and certainly not in stdc. No
functions from malloc.h are actually used here, and stdlib.h is enough.
2020-04-05 09:08:44 +00:00
zoff99
4ec65c28d7
Show function names in asan/tsan stack traces on CircleCI. 2020-04-04 21:32:43 +00:00
iphydf
0964961557
Migrate format-source script to new apidsl web app.
This one is unfortunately a little more complicated to use. I may add a
simpler API later, but for now, it's JSON-based (because I couldn't get
binary data to work without it getting mangled somewhere along the way -
JSON is at least text-transport-safe).
2020-04-04 21:18:05 +00:00
Maxim Biro
40dd88596e
Add minimal save generator 2020-04-04 16:38:28 -04:00
iphydf
4b73607b6f
Fixes towards building on MSVC. 2020-03-29 02:56:09 +00:00
iphydf
44e13956ef
Mark conference test as small.
This used to take a long time, but is now very fast.
2020-03-27 14:51:45 +00:00
sudden6
6732e5ef2f
Add basic test adapter for AFL 2020-03-24 16:49:41 +01:00
iphydf
ef7058422e
Smarter setup of bazel remote cache on Cirrus CI.
We now check whether the cache application is reachable and running via
cURL. If it's running, we add the `--config=remote` line.
2020-03-22 20:45:30 +00:00
Robin Linden
30b9369b01
Release 0.2.11 2020-03-22 21:12:04 +01:00
iphydf
b004736830
Install libsodium from apt instead of from source. 2020-03-22 11:22:06 +00:00
iphydf
f148d5bd0a
Minor cleanups in network code.
Remove useless parameter, replace with assert (just to be sure). Also
replaced some memsets with 0-initialiser and memcpy with assignment.
2020-03-22 11:06:45 +00:00
iphydf
d5ae583c2f
Minor cleanup: use assoc_timeout function where possible.
This function exists and simplifies some code a little bit. There are
lots of places in DHT.c where we have the exact same code, so there is a
lot of opportunity to factor out common bits. For now, we just make a
minor improvement that's easy to review.
2020-03-22 01:49:04 +00:00
zugz (tox)
da93f054fe
fix typo: now we periodically try to send direct packets when connected by tcp 2020-03-22 01:38:47 +00:00
iphydf
ba95314845
Remove bazel build from Travis.
We already have one on Cirrus, and it works fine.
2020-03-22 01:20:11 +00:00
iphydf
88814e9f1d
Disable bazel remote cache on CI.
code.tox.chat is down.
2020-03-21 20:30:12 +00:00
zugz (tox)
94c2a5182b
clear out old conference connections
This may fix problems with very large conferences. Sadly, it seems
infeasible to test large conferences on one machine, so this is entirely
theoretical.
2020-03-18 00:00:00 +00:00