Commit Graph

4050 Commits

Author SHA1 Message Date
Diadlo
b19a9e5464
Add part of platform-independent network API implementation
socket      -> net_socket
htons       -> net_htons
htonl       -> net_htonl
connect     -> net_connect
sendto      -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
2017-02-26 23:16:16 +03:00
Maxim Biro
b2d04eae9d Use VLA macro 2017-02-21 15:54:53 -05:00
Maxim Biro
1cc119c7a3 Fix libsodium unresolved external symbol errors 2017-02-20 06:55:36 -05:00
Maxim Biro
227b436339 Fix pthreads in AppVeyor build 2017-02-20 06:55:36 -05:00
zugz
bbb979d6ef remove statics used in onion comparison functions 2017-02-11 15:27:48 +01:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
iphydf
895de7ef26
Release v0.1.6. 2017-01-26 23:31:27 +00:00
Yuri
2f62fa38fc
Replace redundant packet type check in handler with assert. 2017-01-26 22:29:25 +00:00
Diadlo
f00006cf1d
Add platform-independent Socket and IP implementation 2017-01-26 23:11:15 +03:00
Zoff
287a29b826
Add Android build to CI.
Fixes #340
Fixes #457
2017-01-24 11:47:16 +00:00
iphydf
ce0bf232d1
Add appveyor build for native windows tests.
It doesn't compile, yet. A few changes (like VLA support) need to be made
before we can enable appveyor as a required PR check.
2017-01-22 11:56:02 +00:00
zugz
b630121f2f reduce thread-unsafe use of static variables
- rework ip_ntoa() to avoid use of static variables
- rework sort_client_list() to avoid use of static variables
- move static 'lastdump' into Messenger struct
- rework ID2String() to avoid use of static variables; rename to id_to_string()
- fetch_broadcast_info(): attempt to mitigate risks from concurrent execution
- current_time_monotonic(): attempt to mitigate risks from concurrent execution
- comment on non-thread-safety of unix_time_update
2017-01-21 22:08:52 +01:00
iphydf
f185834e9a
Only retry failed tests on Circle CI instead of all.
Retrying all tests is more likely to result in a different set of tests
failing the second time. This change makes sure only the failed tests are
retried.
2017-01-20 17:05:32 +00:00
iphydf
995578f103
Release v0.1.5. 2017-01-19 18:26:48 +00:00
iphydf
f58dbe2503
Limit number of retries to 3. 2017-01-19 15:58:03 +00:00
iphydf
a74ab7cd1a
Make Travis tests slightly more robust by re-running them. 2017-01-19 12:35:22 +00:00
iphydf
8f96ca6d86
Update license headers and remove redundant file name comment.
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
2017-01-19 00:01:44 +00:00
iphydf
6d6a4e1e3a
Add tutorial and "danger: experimental" banner to README. 2017-01-18 18:13:31 +00:00
iphydf
a22f5e7c6f
Clarify how the autotools build is done on Travis. 2017-01-18 10:56:16 +00:00
Carsten Brandt
86e67f805a decouple version-sync script from cmake 2017-01-18 11:20:07 +01:00
Carsten Brandt
3520eee05d SO versions for cmake and libtool
this updates the version-sync script to generate proper SO versions
which will be used by cmake and libtool to create version symlinks
on the system when a library is installed as well as setting the SO
version in the binary.

To see what this does, you have to configure tox with a prefix:

    ./configure --prefix=/tmp/tox-with-libtool
    mkdir cbuild && cd cbuild && cmake -DCMAKE_INSTALL_PREFIX=/tmp/tox-with-cmake ..

Then run `make && make install`.

in both instances you should see the following installed in `lib/`:

    libtoxcore.so -> libtoxcore.so.1.4.0
    libtoxcore.so.1 -> libtoxcore.so.1.4.0
    libtoxcore.so.1.4.0

inside the binary the soname should be the one with .1 and it should not
contain the full version:

    $ objdump -p libtoxcore.so.1.4.0 | grep SONAME
      SONAME               libtoxcore.so.1
2017-01-18 11:20:07 +01:00
Sergey 'Jin' Bostandzhyan
3f24f04876 Setup autotools to read .so version info from a separate file
We want to use the same libtool style .so versions in both build systems,
ideally both systems should read the version information from the same
configuration file.

This commit introduces an so.version configuration file and sets up
the autotools to use it.

The version numbers in so.version define the ABI compatibility and should be
updated prior to each release.

implements #323
2017-01-18 11:20:07 +01:00
iphydf
5ad3c98905
Make building DHT_bootstrap in cmake optional.
It's enabled by default.
2017-01-16 22:43:41 +00:00
Yuri
68f80d260b Fixed FreeBSD build failure due to undefined MSG_NOSIGNAL. 2017-01-13 00:24:00 -08:00
iphydf
27a97a8280
Release v0.1.4. 2017-01-12 15:48:39 +00:00
iphydf
6480765222
Clarify that the pass key new function can fail.
Also clarify that passwords can be empty or NULL.
2017-01-12 01:09:44 +00:00
iphydf
8b4eae4038
Remove TOX_DEBUG and have asserts always enabled.
These are cheap asserts. I've also replaced the fprintf's with
`LOGGER_ERROR` calls.
2017-01-11 19:43:08 +00:00
iphydf
583d71680e
Check that TCP connections aren't dropped in callbacks.
They aren't, but it's unclear whether it's structurally impossible.
2017-01-11 17:25:39 +00:00
iphydf
958aa43bdf
Fix logging condition for IPv6 client timestamp updates. 2017-01-11 15:10:52 +00:00
iphydf
2ba967d078
Always kill invalid file transfers when receiving file controls.
Previously, toxcore would send a kill control to the friend only if the
file control was valid. Determining which file transfer is used does not
depend on the specific file control. We can always kill it in that case.

Also, added some logging for file control logic, since there is no other
feedback on error (failure of the file control handler is swallowed).
2017-01-10 16:26:44 +00:00
iphydf
5c248e9d11
Minor simplification in file_seek code.
Details in comments.
2017-01-10 12:34:29 +00:00
Sergey 'Jin' Bostandzhyan
2d7507314a Explicitly check if compiler supports C99
c-tocxocre will start using C99 code, so check if the compiler supports
it and abort in configure with an error if it does not.

closes #413
2017-01-10 09:55:21 +01:00
Carsten Brandt
6ec23c98bd
Add soversion to library files to generate proper symlinks
As mentioned in https://github.com/TokTok/c-toxcore/issues/359#issuecomment-270710463
the current CMake build does not generate version symlinks for library .so files.
This is because the version is not specified for library targets.

See
- https://cmake.org/cmake/help/v3.0/prop_tgt/SOVERSION.html#prop_tgt:SOVERSION
- https://cmake.org/cmake/help/v3.0/prop_tgt/VERSION.html#prop_tgt:VERSION

Use PROJECT_VERSION_MAJOR and MINOR for SOVERSION because
api may break from 0.1 to 0.2 in the 0.x release cycle.
2017-01-08 19:18:06 +01:00
Carsten Brandt
31eaffe44b
added comment to magic code in CMakeLists.txt
This part has been added in
67ac9138ab
Took the commit message to provide a comment in the file.
2017-01-08 19:16:09 +01:00
iphydf
20be9a8c5b
Fix NaCl build: tar was called incorrectly.
tar -jxf expects a file.
2017-01-08 16:37:56 +00:00
iphydf
8f1dbaa2c5
Set up autotools build to build against vanilla NaCl.
Fixes #363.
2017-01-08 15:27:26 +00:00
iphydf
bec03de2ba
Run windows tests but ignore their failures.
This way we can at least see what fails in which way.
2017-01-07 22:59:25 +00:00
iphydf
81d5c22502
Don't use git.depth=1 anymore. 2017-01-07 21:50:20 +00:00
endoffile78
d41bb3a8d4
Fix issues in crypto_test.c 2017-01-07 11:47:31 -06:00
iphydf
d6d14b5430
Remove \ at end of list in makefile. 2017-01-07 11:47:30 -06:00
endoffile78
e667ec23b9
Replace make_quick_sort with qsort 2017-01-07 11:47:30 -06:00
iphydf
9d56db3a54
Avoid accessing uninitialised memory in net_crypto.
On x86 and x86_64, this change has no effect. On IA64, this fixes a
potential hardware exception. A function returned a partially initialised
value of aggregate type. The only caller of this function checks that the
value is valid before accessing it by testing the one definitely
initialised member. Therefore on x86 and derived architectures, there is
no uninitialised memory access. On IA64, with the regular calling
convention, the struct is allocated on the caller stack and passed as a
pointer, so there the uninitialised memory is also never accessed.
However, on calling conventions where one or more struct members past the
first byte are passed in registers or copied in memory, this call can
cause undefined behaviour.

Specifically, the value can contain a trap representation of the integers
(at the very least the 16 bit port) and cause a hardware exception and
SIGFPE in userland.

Regardless of the explanation above, this change fixes an instance of
undefined behaviour that just happened to be OK on all systems we tested
on.
2017-01-07 01:49:30 +00:00
iphydf
3fb683115c
Add logging callback to messenger_test.
So we can see what went wrong if it fails.
2017-01-06 23:25:46 +00:00
iphydf
01cb35c1f6
Warn on -pedantic, don't error yet.
We still have some non-standard C code in toxcore for now.
2017-01-06 22:19:13 +00:00
Maxim Biro
e7270aa99d Fix bad attempt at refactoring 2017-01-06 16:32:39 -05:00
iphydf
e4d81e1520
Eliminate dead return statement.
Previously, the `ipv6` variable was initialised to `-1`, but that value
was never read. Either it was set to 0 or 1, or the function would return
before it was read. Thus, I've changed it to uninitialised `bool is_ipv4`
(inverted semantics to avoid negative conditions `if (!is_ipv6)`).

The `pack_ip_port` function is a bit unfortunate, but I'm not rewriting
it until we have a binary writer (I'd be rewriting it twice).
2017-01-06 13:53:49 +00:00
David Zero
8ef1f35ca7 Revert "Revert "Portability fixes""
This reverts commit 59e2a844f0, and
defines _DARWIN_C_SOURCE in toxcore/network.c
2017-01-06 04:20:00 -08:00
iphydf
08cd61387e
Add an OSX build that doesn't run tests.
This one is not allowed to fail and ensures that toxcore can at least be
built for OSX.
2017-01-06 00:40:29 +00:00
iphydf
fdb46f6cf2
Release v0.1.3. 2017-01-05 22:02:11 +00:00
endoffile78
59e2a844f0 Revert "Portability fixes"
This reverts commit f3469070fe.
2017-01-05 15:16:56 -06:00