Commit Graph

4795 Commits

Author SHA1 Message Date
zugz (tox)
c644ef7681
use -1 rather than ~0 in unsigned integer types
Using ~0 involves a bitwise operation on int, so depends on
the internal representation of signed integers.
2020-03-14 00:00:02 +00:00
iphydf
e671490989
Use rules_cc instead of native cc_library rules. 2020-03-12 12:20:54 +00:00
iphydf
64bf3695d9
Add a mutex lock/unlock inside every public API function. 2020-03-11 15:21:43 +00:00
Maxim Biro
fd5511ad37
Enable FreeBSD jobs on Travis-CI 2020-03-10 06:35:48 -04:00
Maxim Biro
26fd89437b
Update and fix FreeBSD setup on Travis-CI
- Bump FreeBSD to 12.1.
- Simplify stage1 logic.
- Re-try downloading the image from a different mirror if one fails.
- Use the `expect` utility instead of dealing with screen's log file.
- Re-run failed toxcore test one more time and in sequence.
2020-03-10 06:16:00 -04:00
iphydf
bd7b7fadba
Pass packet ID to custom packet handlers.
We don't expose this to the user code, yet, because it would break the
API, but this is useful for future internal code.
2020-03-08 19:17:50 +00:00
iphydf
7b3d2eda3f
Use net_pack instead of casting bytes to ints.
The current code violates the C standard and causes crashes on strict
alignment architectures.
2020-03-06 11:05:52 +00:00
iphydf
7923a61959
Use ninja build system for the cmake-linux build. 2020-03-05 23:02:54 +00:00
iphydf
e35d70af18
Use net_pack/unpack instead of host_to_net.
The latter is doing pretty much the same thing but in a confusing way (it
doesn't change the type of the variable, but does change the semantics).
2020-03-05 22:56:26 +00:00
iphydf
cbc26d9b16
Disable FreeBSD travis build until it is fixed. 2020-03-05 13:09:01 +00:00
Maxim Biro
7c63b0f734
Update tox-bootstrapd's dockerfile to use Debian Buster 2020-03-03 01:23:24 -05:00
Maxim Biro
ac5c9ebce4
Fix tox-bootstrapd's README 2020-03-03 01:23:22 -05:00
iphydf
28baf9632f
Remove testing/av_test.c.
It's a maintenance burden. Nobody uses this. It depends on an ancient
version of opencv that less and less systems actually have.
2020-03-02 21:07:55 +00:00
zugz (tox)
2dc639a8a4
bump to astyle-3.1 in travis build 2020-03-02 15:31:48 +00:00
iphydf
e618829112
Add "cimple_test" to the bazel build. 2020-03-02 15:20:34 +00:00
iphydf
0f7138c010
Upgrade bazel to 2.1.1.
Removed av_test, because it depends on an ancient opencv that starts to
really not exist on modern systems anymore.
2020-03-02 14:23:44 +00:00
zugz (tox)
f6c3ce6d1f
handle message_number wraparound 2020-01-22 00:00:02 +00:00
zugz (tox)
886b9a7019
workaround for message number saving (fixes #961)
Put a future message number into the save file.

Peers require the message numbers of messages we send to increase
monotonically. If we save the current message number, then send further
messages, then quit without saving (e.g. due to a crash), and then
resume from the old save data, then monotonicity will fail. This commit
works around this problem by introducing an offset when the current
message number, so that even in the above circumstance, as long as fewer
messages than the offset were sent between saving and reloading, the
sent message numbers will increase monotonically.

The choice of offset is a balance between wanting it to be large enough
that there is room for plenty of messages to be sent in the above
scenario, and wanting to avoid the following potential problem: if we
repeatedly save and reload without sending any further messages, then
the message number may increase so far that peers will interpret an
eventual message as being old. This is not conceivably a practical issue
for the 32bit lossless message numbers, but is a concern for the 16bit
lossy message numbers.
2020-01-22 00:00:02 +00:00
zugz (tox)
e6cbe907ac
refactor 2020-01-22 00:00:00 +00:00
sudden6
683bc802e2
fix ToxAV threading documentation
ToxAV is not thread-safe at the moment, remove that claim from the
header file.
2020-01-02 11:58:52 +01:00
sudden6
1b7d7b66c5
synchronize call control actions to tox_iterate 2020-01-02 11:58:42 +01:00
sudden6
393a6be5c4
don't wait for connection when killing Tox
When tox_kill is called no other thread should be running anymore so
this locking is not needed there.
2019-12-25 14:56:43 +01:00
sudden6
6338cb46ad
fix invalid use of mutex
- Moving a pthread_mutex in memory (e.g. via realloc()) is undefined
  behavior.
- add a state for allocated but not yet used crypto connections
- change crypto_connection_status signature
2019-12-23 23:48:15 +01:00
sudden6
abfd90d25b
fix log message creating data race 2019-11-21 23:47:03 +01:00
sudden6
a29d5805a6
fix missing mutex 2019-11-21 23:47:02 +01:00
sudden6
81728addb2
fix ToxAV mutex released to early 2019-11-21 23:46:59 +01:00
crypto-universe
74fc646d45
Add VScode folder to .gitignore 2019-11-17 13:59:12 +01:00
zugz (tox)
08e6a1863e
bump libsodium version in appveyor.yml and windows Dockerfile 2019-11-17 13:40:34 +01:00
zugz (tox)
2677a53ee0
Fix miscellaneous small problems with groups:
* unset global status callback in kill_groupchats
* avoid dangling friend connections
* fix num_introducer_connections leak
* stop trying to keep connection alive on freeze
* avoid relaying lossless messages back to sender where possible
* avoid sending gratuitous online packets
2019-11-17 13:29:10 +01:00
Robin Linden
79748dd9e5
Allow Bazel to rerun tests marked as flaky 2019-11-17 01:24:02 +01:00
Robin Linden
f6235b5f8d
Update tests to use a working bootstrap node 2019-11-02 15:35:21 +01:00
Robin Lindén
1f89a57180
Fix pthread_mutex_destroy getting too many arguments 2019-09-18 23:26:13 +02:00
sudden6
ca370df651
don't update the overflow state in current_time_monotonic
This could make mono_time loose overflows on Windows.
2019-09-09 01:31:49 +02:00
sudden6
571897cecb
fix concurrency issues in mono_time
Since mono_time is accessed from the main thread as well as the toxav
thread it is needed to properly lock time updates.
2019-09-06 23:10:39 +02:00
sudden6
3d21e66a8a
fix overflow in peer nick len 2019-08-04 16:38:53 +02:00
sudden6
8ed83c3d4c
fix missing group title length check
This fixes a buffer overflow when a malformed *.tox save file is
loaded.
2019-08-04 16:38:49 +02:00
Robin Lindén
7418174129
Force IPv4 for cirrus-ci tests 2019-07-21 16:23:33 +02:00
Robin Lindén
7aab0d9952
Release 0.2.10 2019-05-30 15:36:12 +02:00
zugz (tox)
306dd1f21f
add configurable limit on number of stored frozen peers 2019-05-19 18:51:28 +02:00
Evgeny Kurnevsky
d26b11d0c2
Do not send the same packet to the same node twice. 2019-05-01 16:40:04 +02:00
sudden6
b3100c977c
add undef guard in tox_many_tcp_test
This fixes an redefinition error when creating amalgamation.cc during
static analysis
2019-05-01 14:24:46 +02:00
zugz (tox)
efff822aef
Disable failing TCP server test
The test's intermittent failure may well be exposing a real bug in the
TCP relay and/or onion systems, but we can't find the bug, and keeping
the test is disrupting our CI.
2019-04-01 19:43:32 +02:00
iphydf
a49cbe582d
Fix bazel build version at 0.22.0 for CI.
To make this reproducible. With floating versions (always latest), this
can break any time a new bazel version is released.
2019-03-24 21:59:39 +00:00
zugz (tox)
d14989f6df
put toxav.h stuff in toxav.api.h 2019-02-10 18:17:59 +01:00
zugz (tox)
695fa4373a
explain enabling in API comment 2019-02-10 00:00:00 +00:00
zugz (tox)
959f468eac
add API function to test whether av is enabled 2019-02-10 00:00:00 +00:00
zugz (tox)
49e2406ffa
Expose api functions for enabling and disabling AV in AV groups
A group loaded from a savefile starts with AV disabled.
2019-02-10 00:00:00 +00:00
zugz (tox)
0aad180d1e
Specify that buffer size for tox_conference_peer_get_name is given by $size 2019-01-21 22:17:49 +01:00
Robin Lindén
98b754e1f2
Release 0.2.9 2019-01-12 23:35:54 +01:00
zugz (tox)
a4bca35a1a
Add some const qualifiers
(Implementing suggestions of sudden6)
2019-01-12 22:38:51 +01:00