Age | Commit message (Collapse) | Author |
|
Using the full path including the repo name.
|
|
|
|
|
|
|
|
* Moved PAIR to toxav, where it's used (but really this should die).
* Replace most MIN calls with typed `min_*` calls. Didn't replace the
ones where the desired semantics are unclear. Moved the MIN macro to
the one place where it's still used.
* Avoid assignments in `while` loops. Instead, factored out the loop body
into a separate `bool`-returning function.
* Use named types for callbacks (`_cb` types).
* Avoid assignments in `if` conditions.
* Removed `MAKE_REALLOC` and expanded its two calls. We can't have
templates in C, and this fake templating is ugly and hard to analyse
and debug (it expands on a single line).
* Moved epoll system include to the .c file, out of the .h file.
* Avoid assignments in expressions (`a = b = c;`).
* Avoid multiple declarators per struct member declaration.
* Fix naming inconsistencies.
* Replace `net_to_host` macro with function.
|
|
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.
2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
could go backward in time but I think I might have started using it like
if it could not after I changed it so that it would never go back in time
```
|
|
In preparation for adding log statements.
Also, fix an uninitialised variable warning in cppcheck.
|
|
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.
|
|
|
|
Windows doesn't report network errors though errno, it has its own facilities.
|
|
|
|
|
|
|
|
This changes only code, no string literals or comments.
|
|
|
|
The ping.api.h file looks rather ugly, but it works. This is an exercise
in finding the complete set of use cases needed from apidsl for toxcore.
We'll try to make things work as much as possible, and then make apidsl
better and make the .api.h files pretty.
|
|
To make it an abstract type everywhere except in network.c.
|
|
Based on #331.
Fixes #42.
|
|
|
|
|
|
|
|
|
|
|
|
This reverts commit 5ff099763b1f56414572e1c12eb2f003117db5a0.
|
|
Found these missing includes while compiling on FreeBSD 11.
|
|
|
|
|
|
Fix #494
|
|
socket -> net_socket
htons -> net_htons
htonl -> net_htonl
connect -> net_connect
sendto -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
|
|
|
|
|
|
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.
|
|
- 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
|
|
"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".
|
|
Hex constants make it clearer that you can only use 2 nibbles (the two
digits of the number, displayed as two columns in the source code), i.e.
1 byte, for the packet kind. It also makes the bit representation easier
to see.
|
|
fixup! TravisCI shorten IRC message
|
|
- Mingw32 didn't read MSDN, so behaves badly despite lean and mean.
- Avoid alignment issues on windows with packed bitfields in the RTP header.
This change makes the program ill-formed in C99, but I don't know the correct
fix at the moment, and I don't want to keep the Windows build broken for too
long.
|
|
|
|
- Don't cast between object and function pointers.
- Use standard compliant `__VA_ARGS__` in macros.
- Add explicit `__extension__` on unnamed union in struct (it's a GNU
extension).
- Remove ; after function definitions.
- Replace `const T foo = 3;` for integral types `T` with `enum { foo = 3 };`.
Folding integral constants like that as compile time constants is a GNU
extension. Arrays allocated with `foo` as dimension are VLAs on strictly
compliant C99 compilers.
- Replace empty initialiser list `{}` with zero-initialiser-list `{0}`.
The former is a GNU extension meaning the latter.
- Cast `T*` (where `T != void`) to `void *` in format arguments. While any
object pointer can be implicitly converted to and from `void *`, this
conversion does not happen in variadic function calls.
- Replace arithmetic on `void *` with arithmetic on `char *`. The former
is non-compliant.
- Replace non-`int`-derived types (like `uint16_t`, which is
`short`-derived) in bit fields with `int`-derived types. Using any type
other than `int` or `unsigned int` (or any of their aliases) in bit
fields is a GNU extension.
|
|
|
|
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
|
|
See #27 and #40 for details.
|
|
* Add #defines for INET/INET6 returns
* Remove magic number 3 - exact AF_INET/INET6 result found.
* Updated network_test.c
|
|
|
|
|
|
|
|
|
|
Moved some functions to onion.c.
Fixed possible portability issues.
|
|
Added length checks to ipport_pack() function.
|
|
|