Commit Graph

4964 Commits

Author SHA1 Message Date
iphydf
e4ad0c833c
cleanup: Enforce for loop consistency.
All for-loops must have an init-decl, a condition, and an increment
statement. Any loop that doesn't have one of these should be a while
loop (only 2 of these exist in toxav, none in toxcore).
2021-12-09 14:53:00 +00:00
iphydf
fa359091c7
chore: Minor cleanups of warnings given by cppcheck. 2021-12-09 11:08:03 +00:00
iphydf
044a93081a
chore: Add workflow for running coverity scan. 2021-12-08 00:23:11 +00:00
iphydf
2bc83a4b51
cleanup: Use static_assert instead of preprocessor #error.
`ccompat.h` ensures that if it doesn't exist, then `static_assert` has no
effect.
2021-12-07 18:42:29 +00:00
jfreegman
edf9d66717
Add logger to onion and onion announce objects
This will be used in the future
2021-12-07 13:01:15 -05:00
iphydf
51a2acd1f5
cleanup: Avoid endian-specific code in crypto_core. 2021-12-07 17:23:09 +00:00
iphydf
cdc0286050
cleanup: Minor fixes in test code.
* Buffer overrun in auto test.
* Resource leak in AFL test code.
2021-12-07 17:13:58 +00:00
jfreegman
01ea27085f
Refactor kill_nonused_tcp()
This makes the code a little more flat and readable. We also change the
logic so that we can kill the necessary number of unused relays immediately
rather than having to collect them and remove them in a separate loop
2021-12-07 11:50:56 -05:00
iphydf
1ce6aab5da
cleanup: Ensure that error codes are always initialised.
In this case, there was no way it would not be, but a code change down
the stack could cause a variable to become uninitialised. This avoids a
gcc warning and is more locally-correct.
2021-12-07 15:12:42 +00:00
iphydf
101e235131
cleanup: Fix last instance of -Wcast-align and enable the warning.
We used to have lots of these in the code, but now that all the endian
stuff is no longer dependent on host byte order, we can re-enable the
warning flag and catch any future violations.
2021-12-07 14:51:31 +00:00
iphydf
2db6599be5
test: Add some simple tests for list.c.
These are pretty useless, but I'm adding the list_test.cc file for future
better tests to be written in.
2021-12-07 10:32:45 +00:00
Robin Linden
713ce6108c
Improve Tox creation logging in save_load test 2021-12-06 23:28:53 +01:00
Robin Linden
4348b96a5b
Release 0.2.13 2021-12-06 23:28:52 +01:00
jfreegman
ce268c2f82
Add some missing null checks 2021-12-06 16:57:07 -05:00
iphydf
d930ecca4c
chore: Run infer static analyser on circle ci builds.
Also running some other analysis that we used to have on Travis.
2021-12-06 20:25:50 +00:00
iphydf
af1848ed13
chore: Use toktok-stack docker image with built third_party.
This should cut down the build time a bit by downloading the binaries
built for `//third_party/...`.
2021-12-05 19:21:57 +00:00
sudden6
0320e2eb8e
fix missing braces in computed macro value
Using this value in any computation might not work as expected.
2021-12-05 14:20:04 +01:00
sudden6
1b02bad368
fix possible stack overflow
CRYPTO_SIZE is used in a subtraction as second argument and instead of
subtracting then intended value only '1' is subtracted due to operator
precedence rules and missing braces.
2021-12-05 14:20:00 +01:00
zugz (tox)
f12347dfec
Fix buffer over-read when a peer leaves a conference
Fixes 1598 -- thanks to peirick for reporting the bug.
2021-12-01 20:31:50 +00:00
iphydf
57b0651ffd
test: Add some unit tests for important internal DHT functions.
We definitely need more of this kind of test so refactorings don't
accidentally break things in ways that happen to still work in auto
tests.
2021-12-01 14:08:37 +00:00
sudden6
fd73f3eeb6
add logging when connection limits file transfer speed 2021-11-30 15:55:00 +01:00
sudden6
286cc44f54
rewrite filetransfer logic in Messenger.c
Makes the logic easier to follow and removes suspicious case.
2021-11-30 15:54:58 +01:00
sudden6
10ddf8097c
rewrite loop for better understanding 2021-11-30 15:53:31 +01:00
sudden6
825d457073
simplify do_all_filetransfers
This should not change any behaviour of this function.
2021-11-30 15:52:27 +01:00
zugz (tox)
01c3869bd0
Add instructions for building unit tests to INSTALL.md 2021-11-30 14:10:16 +00:00
sudden6
0c320462d7
perf: reduce calling into Mono_Time in DHT
Mono_Time needs to acquire a lock each time one of its functions are
used. This becomes very costly in the DHT code where timeouts for all
connected nodes are recalculated. Improve this by caching the timestamp
at the begin of a do_dht() iteration.
2021-11-29 19:02:17 +01:00
jfreegman
8b725c1ecc
Fix some friend connection issues
- Properly handle crypto_connection_status() failure
- Remove CONNECTION_UNKNOWN and restructure surrounding logic so that
  the API no longer reports erroneous friend connection statuses
2021-11-27 19:27:55 -05:00
jfreegman
c0a0a8204c
Fix bug causing API to report wrong self connection status 2021-11-27 18:43:35 -05:00
iphydf
99d873b985
chore: Enable cimple tests on cirrus build.
This ensures that we don't break Cimple compatibility despite Travis
being gone (which used to test this).
2021-11-27 02:56:17 +00:00
jfreegman
b66165977e
fix issue with save_load autotest
The test explicitly wanted a UDP connection when a TCP connection would suffice. This
was a remnant of back when the test was part of a multi-purpose autotest that
didn't attempt to connect to TCP relays and needed a UDP connection specifically.
2021-11-25 15:32:29 -05:00
iphydf
1700334c3b
chore: Upgrade to toktok-stack:0.0.11. 2021-11-25 18:32:50 +00:00
cryptogospod
13cca6716d
Update IRC info 2021-09-18 00:02:57 +02:00
Robin Linden
485fe88253
Get Appveyor and Cirrus CI to pass again
* Fix Appveyor CI build

The problem was that when running commands in powershell, any stderr
output is treated as an "exception", stopping the build even if the exit
code of the command was good.

* Add workarounds to get Cirrus CI to pass

Removing the cache isn't great, but the build is still only 5-7 minues,
so it's not terrible either.

Disabling the tcp_relay test also sucks. It passes locally, so we're
likely getting caught in a firewall or something like it somewhere.
2021-09-17 23:43:09 +02:00
sudden6
25a56c3549
simplify do_tcp(...) 2021-04-12 19:01:10 +02:00
Alexandre Petitjean
c9ad4a2e39
Enable c-toxcore conan packaging 2021-04-11 15:56:02 +02:00
Maxim Biro
6f3cdb1780
Remove references to Tox's package repository
Since it's shut down
2021-03-02 04:25:53 -05:00
Maxim Biro
d8c676bb01
Remove references to Jenkins
Since we are shutting it down
2021-03-02 04:25:32 -05:00
Maxim Biro
0d5f85485b
Update deps used in Windows build scripts 2021-02-25 13:59:18 +03:00
redmanmale
98c148179f
Add Cygwin build script 2021-02-25 13:57:42 +03:00
Robin Linden
a71ddc7eac
Fix tests involving reading/writing files failing on Windows
The issue was that r and w without the b flag on Windows does LF and CR
translations when reading and writing. Not good for binary files.
2020-11-21 13:02:31 +01:00
jfreegman
00f2f41dbb
Use heap memory instead of stack for large variables
The default stack size for musl-libc is 128kb. Therefore we should try to keep stack
allocations well below this limit in order to avoid stack overflows.
2020-11-20 19:15:58 -05:00
Robin Linden
5d2b1e3861
Update tox-bootstrapd checksum due to newer packages in Alpine
* g++       9.2.0-r4  -> 9.3.0-r0
* gcc       9.2.0-r4  -> 9.3.0-r0
* libatomic 9.2.0-r4  -> 9.3.0-r0
* libcurl   7.67.0-r0 -> 7.67.0-r1
* libgcc    9.2.0-r4  -> 9.3.0-r0
* libgomp   9.2.0-r4  -> 9.3.0-r0
* libstdc++ 9.2.0-r4  -> 9.3.0-r0
* python3   3.8.2-r0  -> 3.8.2-r1
2020-11-16 16:22:55 +01:00
Robin Linden
470fa79f92
Fix AppVeyor failing due to conan remote being added twice 2020-06-12 11:25:55 +02:00
Robin Linden
56992b099e
Add support for the conan C/C++ package manager
* Don't overwrite the CMAKE_MODULE_PATH
* Allow linking libsodium statically with MSVC
* Allow finding libsodium the normal way on MSVC
* Allow using pthreads4w for pthreads on MSVC
* Fall back to find_package if pkg_find_module fails
* Don't pass incompatible compile flags to MSVC
* Also try to find Opus and libvpx using their canonical names
* Support building using conan
* Allow pkg_use_module to take a list of libraries to look for
* Build for Windows on Appveyor using conan
2020-05-29 15:36:26 +02:00
iphydf
03a511482f
Format comments according to tokstyle's requirements. 2020-05-17 18:16:42 +01:00
iphydf
fe8e0fb8fa
Fix tcp_relay_test by adding a second bootstrap node.
This is a non-hermetic network test. initramfs node is down, so let's
have a second one for redundancy.
2020-05-17 12:41:00 +01:00
iphydf
3d601fe320
style: Run restyled on Travis and Circle CI scripts. 2020-05-08 01:31:24 +01:00
iphydf
8f4400b9b4
cleanup: Make pylint and mypy happy with bootstrap_node_info.py. 2020-05-06 10:59:47 +01:00
iphydf
3851cfb652
Add autotools build to localbuild docker images. 2020-05-05 23:41:16 +01:00
iphydf
8c0fd40356
refactor: Remove multi-declarators entirely.
We no longer allow `int a, b;`. In the few cases where we used it, we
instead better

* limit the scope of the identifier (e.g. in a for-init-decl)
* split the line and have 2 separate declarators, because the
  identifiers designate different types of things (e.g. friend numbers
  and group numbers).
2020-05-05 23:22:29 +01:00