Age | Commit message (Collapse) | Author |
|
|
|
Should lower CPU usage by a bit.
|
|
Significantly trimmed down version of an ID<=>IP cache.
|
|
|
|
timeout (KILL_NODE_TIMEOUT), reset them all to BAD_NODE_TIMEOUT.
That keeps the client trying to at least ping the nodes in the hopes of the connection coming back up.
|
|
entries).
id_hash() was not at all working as expected for very small bucket size (when (size / 4) was zero). Simplified to be trivially correct.
Also added a used flag on adding an entry, which is set by callers if they have that association in active use. Those get priority over unused entries on collision.
Fleshed out test to be at least elementary useful.
Each group chat now uses an own, small assoc (80 entries).
|
|
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
|
|
Also check both associations for timeout, not just the incoming one.
Also removed client_in_list(): static & unused.
|
|
DHT_test now only prints non zero entries.
|
|
|
|
Conflicts:
toxcore/DHT.c
|
|
https://github.com/FullName/ProjectTox-Core into FullName-add2lists_forward
|
|
handle_sendnodes_core(), leave only a minimal trail.
|
|
Avoids a DOS of sending a copy of a valid response with an invalid IP.
|
|
|
|
|
|
Also removed some old, useless loading code.
|
|
|
|
|
|
|
|
|
|
|
|
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()
|
|
|
|
|
|
always off).
Additionally (besides cleanups):
network.h/tox.h:
- WIN32: fix a strange sa_family_t definition
- WIN32: define EWOULDBLOCK to WSAEWOULDBLOCK
- WIN32: kill macro for an existing function (IN6_ADDR_EQUAL)
network.c:
- use EWOULDBLOCK instead of EAGAIN (same value, but EWOULDBLOCK is more "popular")
- new_networking(): only try to enable IPv4-in-IPv6 if it's not already enabled per default
- inet_ntop()/inet_pton(): WIN32: remove partial initializers in favor of a simple memset()
- ip_equal(): WIN32: use an existing function
- logging: networking_wait_execute(): only dump result if not timeout
- logging: loglogdata(): kill an unused variable
LAN_discovery.c:
- send_broadcasts(): re-enabled, can only support IPv4 by principle, split into fetch_broadcast_info() (to fetch the addresses once) and send_broadcasts() (actual sending)
DHT.c:
- DHT_load_state_callback(): enclosed a fprintf(stderr, ...) into #ifdef DEBUG
Lossless_UDP.c:
- change_handshake(): harden against strange sa_family_t definitions
Messenger.c:
- logging: fix ID to string conversion
util.c:
- logging: eliminate a signed-warning
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DHT.c:
- loops over assoc4/6 slightly more elegant
|
|
Compilerflag: CLIENT_ONETOONE_IP (to define in DHT.h, default unset i.e. NEW case: two addresses)
Every function in DHT{_test}.c working on Client_data has been rewritten to store IPv4 addresses in assoc4, IPv6 addresses in assoc6.
Loading/Storing of states defined with other compiler switch is transparently adjusting to the differences.
DHT.h, DHT.c:
- introduction and handling of the structure changes
DHT_test.c, Messenger.c:
- logging adapted to new structures
util.h:
- LOGGING isn't undefined per default anymore
|
|
clients were connected.
Increased the number of ports tried per interval of time.
Also astyled the files.
|
|
moved stuff that belongs into ping.[ch] there
|
|
This makes it build on OS X again...
|
|
DHT.*, ping.*:
- moved stuff from struct DHT into struct PING: toping, last_toping
- moved functions add_toping(), do_toping()
- made id_closest() publicly accessible
- send_ping_request(): killed (Net_Crypto *c) parameter in favor of copying it into (PING *) on new_ping()
group_chats.c:
- killed local 1:1 copy in favor of DHT.c::id_closest()
|
|
and treat element zero as the furthest
|
|
into ipv6.yield50%toipv4
|
|
DHT.c:
- we have to actually count the number of addresses in the field, because sort_list() will move the stuff around
- improved replace_good() substantially by throwing away the "furthest" client_id, not the one just a bit worse than the new one (but better than all the later ones in the field!)
|
|
also rename client_in_list() to client_or_ip_port_in_list(), it also checks for an identical ip/port and replaces the client_id, recycling the entry
DHT.c:
- rename client_in_list() to client_or_ip_port_in_list()
- replace_bad(), replace_good(): if IPv6, only insert into the upper half of the given list
- addto_lists(): convert ipv4-in-ipv6 mapped to ipv4
|
|
|
|
util.c:
- fix in empty section at the end of the state, showed as bug when having an empty name
DHT.c:
- fix in saving less data than originally announced, showed as bug when not having reached any clients ever (no clients or only with timestamp of zero)
|
|
|
|
State loading/saving: Instead of a blob, segment into sections marked with tags.
|
|
|