Age | Commit message (Collapse) | Author |
|
|
|
|
|
Also some missing return value checks for `fopen`.
|
|
To make it an abstract type everywhere except in network.c.
|
|
Also fix a mistake with forgotten braces around parameter
|
|
|
|
socket -> net_socket
htons -> net_htons
htonl -> net_htonl
connect -> net_connect
sendto -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
|
|
"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".
|
|
This reverts commit 59e2a844f04a8725e8079f854158aa86ef5988b2, and
defines _DARWIN_C_SOURCE in toxcore/network.c
|
|
This reverts commit f3469070fe899e8e4fd88665386a55bad9f77cd8.
|
|
- CFLAG gnu99 was changed to c99.
- CXXFLAG c++98 was changed to c++11.
- CFLAG -pedantic-errors was added so that non-ISO C now throws errors.
- _XOPEN_SOURCE feature test macro added and set to 600 to expose SUSv3
and c99 definitions in modules that required them.
- Fixed tests (and bootstrap daemon logging) that were failing due to
the altered build flags.
- Avoid string suffix misinterpretation; explicit narrowing conversion.
- Misc. additions to .gitignore to make sure build artifacts don't wind
up in version control.
|
|
|
|
|
|
Cleanups:
- Fix header guards to not use reserved names.
- Avoid name shadowing.
- Removed an unused variable found by avoiding name shadowing.
|
|
- Any non-externally-visible declarations should be `static`.
- Casting away the `const` qualifier from pointers-to-const is
dangerous. All but one instance of this are now correct. The one
instance where we can't keep `const` is one where toxav code actually
writes to a chunk of memory marked as `const`. This code also assumes
4 byte alignment of data packets. I don't know whether that is a valid
assumption, but it's likely unportable, and *not* obviously correct.
- Replaced empty parameter lists with `(void)` to avoid passing
parameters to it. Empty parameter lists are old style declarations for
unknown number and type of arguments.
- Commented out (as `#if DHT_HARDENING` block) the hardening code that
was never executed.
- Minor style fix: don't use `default` in enum-switches unless the number
of enumerators in the default case is very large. In this case, it was
2, so we want to list them both explicitly to be warned about missing
one if we add one in the future.
- Removed the only two function declarations from nTox.h and put them
into nTox.c. They are not used outside and nTox is not a library.
|
|
- 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.
|
|
bootstrap_node_packets.c was giving an error as it was being included
twice and there were no include guards, so part of it was split into
bootstrap_node_packets.h.
|
|
|
|
Warn the user if it wasn't.
|
|
Fixed some issues.
|
|
Fixed a regression (same type as last commit).
|
|
Now next step is integrating it in tox.
Added TCP server functionality to bootstrap server (define TCP_RELAY_ENABLED to enable it.)
|
|
|
|
define DHT_SERVER_EXTRA_PACKETS to enable.
|
|
|
|
|
|
|
|
|
|
unix_time():
- returns local value for current epoch
- value is updated explicitly with unix_time_update() called at new_DHT()/doMessenger()/do_DHT()
is_timeout():
- uses the local value for current epoch
id_cpy()/id_eq() => id_copy()/id_equal():
- centralized duplicate definitions
- replaced (most) memcpy()/memcmp() of (*, *, CLIENT_ID_SIZE) with id_copy()/id_equal()
|
|
Removed deprecated compilation instructions
|
|
|
|
|
|
This patch inserts LAN discovery in DHT_bootstrap, allowing it to find clients even if it's run parameterless (and clients don't connect to it directly, e.g. because the port is already bound to a different client).
- moves the #define of LAN_DISCOVERY_INTERVAL from Messenger.c to LAN_discovery.h
- includes LAN_discovery.h into DHT_bootstrap.c
- DHT_bootstrap.c sends and accepts LAN_discovery packets
|
|
- tox_bootstrap_ex(), DHT_bootstrap_ex() renamed to tox_bootstrap_from_address(), DHT_bootstrap_from_address()
- (handle_)sendnodes_ex() renamed to (handle_)sendnodes_ipv6()
- only sending sendnodes_ipv6() if we're actually IPv6 enabled
- changed comments to conform better
nTox.c, Messenger_text.c, DHT_test.c, DHT_bootstrap.c:
- fallout from *_ex() to *_from_address()
DHT_bootstrap.c:
- corrected a potentially wrong info message
util.c:
- fixed logfile name: now (funcptr) => now() (number)
network.c:
- addead comment about the necessity of bind() to succeed
auto_test/messenger_test.c:
- defaulting ipv6enabled to TOX_ENABLE_IPV6_DEFAULT
LAN_discovery.c:
- slight cleanup and comments for clarity
|
|
- moved cmdline_parsefor_ipv46() to testing/misc_tools.c
|
|
- add missing includes (autobuild warnings)
|
|
- reset errno from failed bind() calls if the last one succeeds
DHT_bootstrap.c:
- move the perror() output next to where it belongs to
|
|
|
|
|
|
|
|
- return to the caller if the string could be resolved into an IP
other/DHT_bootstrap.c, testing/*_test.c, testing/nTox.c:
- parse cmdline for --ipv4/--ipv6 switch to allow user a choice
util.h:
- proper old-style C-comment
|
|
|
|
- IP: add in_addr_t as part of the union
- IP: rename IP to IP4
|
|
|
|
into vx-k-udp_connections
|
|
|