Commit Graph

8 Commits

Author SHA1 Message Date
Lehi Toskin
96e3f7053f Replaced magic numbers inside candidates_create_internal() with enumerated list 2014-02-16 13:19:40 -08:00
irungentoo
dfd46a040a Merge branch 'assoc-refresh-distant-data' of https://github.com/FullName/ProjectTox-Core into FullName-assoc-refresh-distant-data 2013-12-12 21:51:17 -05:00
Coren[m]
ad9d20c08b
do_Assoc(): keep the data of the buckets somewhat current 2013-12-08 05:43:24 +01:00
irungentoo
3d2707748c Merge branch 'sendnodes-with-assoc' of https://github.com/FullName/ProjectTox-Core into FullName-sendnodes-with-assoc 2013-12-05 12:34:14 -05:00
Coren[m]
110a8e889c
get_close_nodes(): make use of assoc to find some really close nodes
DHT.c:
- get_close_nodes(): use assoc to find nodes for the requested reference id
- handle_sendnodes*(): set a proper timestamp for "heard" nodes

assoc.*:
- expand Assoc_close_entries by flags for additional restrictions for search
- Assoc_get_close_entries(): honor the new flags
- new_Assoc() prime handling: min. prime is now 5 instead of 3, and up to 25 is handled directly
- Assoc_status(): added address family for seen/heard, print of hash is now fixed width
2013-12-03 22:36:02 +01:00
alexandervdm
a93d76a958 fix 'typedef redefinition' build errors on older gcc versions
building toxcore
2013-12-01 21:06:20 +01:00
Coren[m]
b132c92b3a
Assoc's array is now allocated dynamically and per default much smaller (320 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).
2013-11-17 01:05:00 +01:00
Coren[m]
0d8329b3a9
Significantly trimmed down version of an ID<=>IP cache.
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
2013-11-14 19:05:53 +01:00