summaryrefslogtreecommitdiff
path: root/toxcore/assoc.c
AgeCommit message (Collapse)Author
2013-12-13Merge pull request #678 from FullName/retipp-fixirungentoo
Fix a code cleanup.
2013-12-12Merge branch 'assoc-refresh-distant-data' of ↵irungentoo
https://github.com/FullName/ProjectTox-Core into FullName-assoc-refresh-distant-data
2013-12-11Fix a code cleanup.Coren[m]
DHT.c: - get_close_nodes(): - allow two 'indirect' nodes ('indirect' as in distant from us and therefore not tested regularly, "bad") - be consequent when testing for NULLed results, pack nodes_list dense - (logging) dump number of found entries from assoc - returnedip_ports(): - fix code cleanup, the entry to be added is about the node we were told, not about the node who told us assoc.c: - Assoc_get_close_entries(): break from loops as soon as a marking-invalid-node is hit
2013-12-08do_Assoc(): keep the data of the buckets somewhat currentCoren[m]
2013-12-07Added/updated some basic docs and cleaned up some things.irungentoo
2013-12-05Added a assoc test.irungentoo
Changed default assoc so that it behaves correctly.
2013-12-05Merge branch 'sendnodes-with-assoc' of ↵irungentoo
https://github.com/FullName/ProjectTox-Core into FullName-sendnodes-with-assoc
2013-12-03get_close_nodes(): make use of assoc to find some really close nodesCoren[m]
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-01fix 'typedef redefinition' build errors on older gcc versionsalexandervdm
building toxcore
2013-11-24Fixed possible build problem.irungentoo
2013-11-17Assoc's array is now allocated dynamically and per default much smaller (320 ↵Coren[m]
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-14Significantly trimmed down version of an ID<=>IP cache.Coren[m]
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.