Commit Graph

4936 Commits

Author SHA1 Message Date
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
zugz (tox)
db07bda7f7
Add "member" invite response
This allows invitations to work in the case that the invitee is already
in the group, which can happen if the group becomes split. Such an
invitation is automatically accepted, leading to the peers becoming
connected in the group and sharing peer lists.
2020-03-18 00:00:00 +00:00
iphydf
84e6a8d057
Make function defns match their decls regarding storage class.
We want functions declared as `static` to also be defined as `static`.
2020-03-18 15:14:31 +00:00
iphydf
36cb30d47d
Check that LOGGER macros are only called with string literals.
Avoid any dynamic format strings, even ones like `cond ? "str1" : "str2"`.
2020-03-18 14:51:56 +00:00
iphydf
1b7bf5b182
Mark file-local function definitions as static.
https://github.com/TokTok/hs-tokstyle/pull/43 implements a validation for
this. We should avoid locally declaring functions from another
translation unit, and instead use header files to export/import them.
2020-03-18 00:53:02 +00:00
iphydf
983c2c44fe
Enable remote cache for bazel builds. 2020-03-17 03:21:54 +00:00
iphydf
52696a0686
Add another bootstrap node to the bootstrap test.
Hopefully not both will be down at the same time.
2020-03-15 23:53:59 +00:00
zugz (tox)
52655b0c1b
clean groups code
* make static functions return bool rather than int to indicate success
* add peer_in_list() to factor out uniformity over peer and frozen lists
* reduce repetition in send_lossy_all_close
* rename 'close' to 'connections'
* use uint32_t for peernumber (in accord with tox.c)
* explain persistence in tox_conference_get_chatlist documentation
* clarify "connectedness" in group API documentation
* clarify that tox_conference_peer_count counts only online peers
* refactor variously
2020-03-15 00:00:27 +00:00
iphydf
8795c5f987
Avoid casting back and forth between void-ptr.
In windows network code, we implement inet_pton and inet_ntop, which take
void pointers. We can do slightly better because we already know the type
when we call these functions, so we can avoid casting between void
pointer and the addr struct types.
2020-03-14 13:48:56 +00:00
iphydf
94d98ddd86
Standardise on having a comma at the end of enums.
Most of our enums already have one. Some didn't. Tokstyle is going to
require commas at the end of enumerator lists in enum definitions.
2020-03-14 13:40:36 +00:00
iphydf
cb22b3df5f
Fix up comments a bit to start being more uniform.
Tokstyle (check-cimple) will start enforcing comment formats at some
point. It will not support arbitrary stuff in comments, and will parse
them. The result can then be semantically analysed.
2020-03-14 13:28:42 +00:00
iphydf
11ad5471b9
Use spdx license identifier instead of GPL blurb. 2020-03-14 13:06:19 +00:00
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