Commit Graph

4371 Commits

Author SHA1 Message Date
hugbubby 4e3bfac47d Another TCP_test.c upgrade
Mostly documentation + comments. Some cases where code was removed
in exchange for more compact/less sprawly for loops. Introduced a
function that removed like 30 lines of repeated code.
2018-06-28 14:05:03 +00:00
cotox 72863b9b80 Add missing MAX_HOSTNAME_LENGTH doc. 2018-06-27 02:58:56 +00:00
cotox 5b14542d3b Make arg host understand clearly.
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-26 11:45:17 +00:00
Robin Lindén ae7899cab8 Release v0.2.3 v0.2.3 2018-06-25 23:49:52 +02:00
iphydf 9b7d828f83 Only run astyle if the astyle binary exists. 2018-06-25 20:35:16 +00:00
iphydf 957508f698 Remove utils.c and utils.h from toxencryptsave build.
These were deleted earlier.
2018-06-25 20:27:21 +00:00
iphydf 12365a7cc9 Fixes to the imported sodium sources to compile without warnings. 2018-06-25 20:09:53 +00:00
iphydf 56d249e5ad Add a MAX_HOSTNAME_LENGTH constant.
Fixes #946.
2018-06-25 19:56:11 +00:00
iphydf d22332dd50 Remove the format test.
It's annoying to have a test touch every source file. It causes a
recompile of everything after every test run.
2018-06-25 19:48:11 +00:00
Maxim Biro 7684b5ae3e Make bootstrap daemon use toxcore's version 2018-06-25 00:29:16 -04:00
iphydf 29b2dd6315 Use clang-format for C++ code.
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24 20:17:53 +00:00
iphydf 5c2600d87b Add new Circle CI configuration.
This one has ASAN enabled, unlike Travis.
2018-06-24 19:51:34 +00:00
iphydf 8e00294b3c Add Logger to various net_crypto functions.
In preparation for adding log statements.

Also, fix an uninitialised variable warning in cppcheck.
2018-06-24 19:17:32 +00:00
iphydf 5a8790eab0 Add a test for double conference invite.
In Persistent Group Chats (PGC), this will cause a use-after-free. This
test ensures that we fix this bug before merging PGC.
2018-06-24 01:09:46 +00:00
iphydf ca75c014a4 Disable UDP when proxy is enabled.
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-23 17:36:37 +00:00
iphydf 64d115e52d Avoid conditional-uninitialised warning for tcp test.
The C compiler warns because the value is initialised in a loop and used
outside of it. In this case, it's always initialised, but changing the
value of `NUM_PORTS` can change that.
2018-06-23 14:39:31 +00:00
iphydf e4462af919 Add assertions to bootstrap tests for correct connection type. 2018-06-23 14:05:56 +00:00
iphydf 9853f4a535 Make NULL options behave the same as default options.
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-23 13:29:11 +00:00
iphydf cfff361679 Add random testing program.
This can be used as a random stress test for toxcore.
Adjust the weights to make certain actions more or less likely.
2018-06-23 12:43:09 +00:00
iphydf a48e0c4d18 Add tests for what happens when passing an invalid proxy host.
Related: https://github.com/qTox/qTox/issues/5174
2018-06-23 12:34:33 +00:00
hugbubby 36e20e7e94 Clarify/Improve test_some test
Better error messages, better sleep() call placements, etc.
Did not modify large chunk of function because I couldn't explain
it. Maybe I'll come back later once I've regained lost brain cells.
2018-06-22 19:52:30 +00:00
iphydf 850d7eac38 Make the net_crypto connection state an enum.
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-22 00:57:22 +00:00
iphydf 2d2b9cfa91 Merge remote-tracking branch 'irungentoo/master' into merge-iru 2018-06-20 23:01:14 +00:00
hugbubby 820e45dece Better TCP testing (beginnings)
Tests all ports instead of just one, also adds some comments/changes
error messages to be more descriptive
2018-06-20 22:11:08 +00:00
iphydf 2296d07e09 Add test for creating multiple conferences in one tox.
This triggers a code path in Persistent Group Chats that causes a memory
leak. I'm adding this test now, so that we don't merge PGC without fixing
the memory leak first.
2018-06-19 21:00:26 +00:00
iphydf 3a85d88fb1 Remove resource_leak_test.
This test has never caught a bug. It's better to catch these with asan or
the likes.
2018-06-18 19:25:30 +00:00
iphydf 90e1d969ac Fix linking with address sanitizer.
`-fsanitize=address` also needs to be passed to the linker.
2018-06-18 19:19:31 +00:00
iphydf 16f5cc8c24 Make dht_test more stable.
By making it run in a port range far away from other tests. This test
creates 100 DHTs and makes either itself or other tests run out of ports.
2018-06-17 23:41:42 +00:00
iphydf a725d73235 Minor cleanup: return early on error condition. 2018-06-17 19:10:15 +00:00
Robin Lindén 2f80e2206c Only check full rtp offset if RTP_LARGE_FRAME is set 2018-06-16 22:50:07 +00:00
lazyrobot adca70111f Add minitox to under "Other resources" section in the README 2018-06-14 12:06:13 +00:00
iphydf b1efa147c0 Sort bazel build file according to buildifier standard. 2018-06-09 21:21:39 +00:00
iphydf cf9caa069a In DEBUG mode, make toxcore crash on signed integer overflow.
Signed overflow is undefined behaviour, so in debug mode, we want to make
it fail in a noisy way.
2018-06-08 23:48:40 +00:00
iphydf 8a4a5c2aa2 Log only the filename, not the full path in LOGGER.
Fixes #900.
2018-06-04 12:39:28 +00:00
yangfl 1af1b61e9d Fix macOS macro because of GNU Mach 2018-06-03 16:00:32 +00:00
Pavel Karelin 184129b9be Fix enumeration of Crypto_Connection instances 2018-05-29 21:40:29 +03:00
iphydf d8efdf17ad Fix ipport_isset: port 0 is not a valid port. 2018-05-23 14:46:50 +00:00
Pavel Karelin 461c8f51f5 Fix the often call of event tox_friend_connection_status
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-23 17:32:18 +03:00
cotox 2d0a21adb3 Fix bootstrap logger
TODO: need a meanful log output
2018-05-22 01:01:18 +08:00
iphydf 21675ce0d2 Finish @Diadlo's network Family abstraction.
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-20 19:35:28 +00:00
iphydf 4f6ab0708c Add empty logger to DHT bootstrap daemons.
These should register a proper logging callback so the messages don't go
devnull, but this at least ensures a logger is available.
2018-05-20 16:15:49 +00:00
iphydf be797d4b03 Move system header includes from network.h to network.c 2018-05-20 15:42:42 +00:00
Anthony Bilinski 291a849a5a fix DHT_bootstrap key loading
Introduced by 643eea60bb
2018-05-10 18:06:13 +02:00
endoffile78 91f65354a2 Make toxcore compile on BSD 2018-05-10 17:56:15 +02:00
Maxim Biro e9629977ad Fix FreeBSD build on Travis 2018-05-10 03:45:43 -04:00
irungentoo fda74a8454 Restrict packet kinds that can be sent through onion path.
Taken from:
https://github.com/TokTok/c-toxcore/commit/6b97acb773622f9abca5ef305cd55bdef1ecc484
2018-04-20 07:40:43 -04:00
Maxim Biro 7d399cedcf Improve network error reporting on Windows
Windows doesn't report network errors though errno, it has its own facilities.
2018-04-17 19:07:50 -04:00
Robin Lindén 2824daf74a Release v0.2.2 v0.2.2 2018-04-18 00:13:16 +02:00
Maxim Biro e16cf49b21 fix broken and unmaintained autotools build 2018-04-18 00:13:15 +02:00
Evgeny Kurnevsky 6b97acb773 Restrict packet kinds that can be sent through onion path. 2018-04-15 09:51:41 +03:00