summaryrefslogtreecommitdiff
path: root/toxcore/DHT.c
AgeCommit message (Collapse)Author
2016-09-12Remove `else` directly after `return`.iphydf
See #78.
2016-09-09Separate IP_Port packing from pack_nodes() and unpack_nodes()Jfreegman
Allows us to pack IP_Port structs that are part of arbitrarily structured data.
2016-09-06Improve static and const correctness.iphydf
- 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.
2016-09-06Make friend requests statelessGregory Mullen (grayhatter)
Messenger is slightly twisty when it comes to sending connection status callbacks It will very likely need at the very least a partial refactor to clean it up a bit. Toxcore shouldn't need void *userdata as deep as is currently does. (amend 1) Because of the nature of toxcore connection callbacks, I decided to change this commit from statelessness for connections changes to statelessness for friend requests. It's simpler this was and doesn't include doing anything foolish in the time between commits. group fixup because grayhatter doesn't want to do it "arguably correct" is not how you write security sensitive code Clear a compiler warning about types within a function.
2016-09-02Do not use `else` after `return`.iphydf
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-09-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-27Move logging to a callback.iphydf
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.
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
2016-08-17Add missing DHT_bootstrap to CMakeLists.txt.iphydf
- This PR also adds a DEBUG cmake option that enables -DTOX_DEBUG. - We also remove `-Wall`, because there are too many warnings, and nobody really looks at them at the moment. We'll see about fixing them soon. We'll also want to enable `-Werror` at some point. - Finally, this PR enables `-O3` to make sure toxcore still works correctly under heavy compiler optimisations.
2016-01-27 add: comment about endiannessRoman Proskuryakov
2016-01-27 fix: compare sensitive data with sodium_memcmpRoman Proskuryakov
fix: make increment_nonce & increment_nonce_number independent of user-controlled input fix: make crypto_core more stable agains null ptr dereference
2016-01-04Cleanups.irungentoo
2016-01-04DHT improvements part 1.irungentoo
2015-12-17Allow 0 length sendnode.irungentoo
2015-12-16Send get nodes instead of ping to timing out nodes.irungentoo
2015-12-16This is still useful.irungentoo
2015-12-16Improved the to_ping list.irungentoo
2015-12-15More efficient DHT searching.irungentoo
2015-12-14Sort list if timed out nodes are in the middle of the list.irungentoo
2015-12-14Send get nodes more to closer nodes than further nodes.irungentoo
2015-12-12Update so this works with the new distance function.irungentoo
2015-12-11Remove useless vars.irungentoo
2015-12-11More DHT fixes.irungentoo
2015-12-11DHT fix.irungentoo
2015-12-11DHT improvements.irungentoo
Feed better nodes to onion, bootstrap off close clients when DHT friend is added.
2015-12-11DHT fix.irungentoo
Return only closest nodes in get nodes packet.
2015-12-11DHT fixes.irungentoo
2015-12-10Check if node can be stored before sorting.irungentoo
2015-12-09Small fix.irungentoo
2015-12-09DHT fix.irungentoo
Improve DHT distance function.
2015-12-08Improve likelyhood of the closest nodes being in our lists.irungentoo
2015-12-08Fixed DHT bug.irungentoo
2015-08-11Remove useless code.irungentoo
2015-08-07Removed a useless define.irungentoo
2015-08-06client_id -> public_keyirungentoo
2015-08-05client_id -> public_keyirungentoo
2015-08-04comp_client_id -> comp_public_keyirungentoo
2015-08-01DHT save fixes.irungentoo
2015-07-30client_id -> public_keyirungentoo
2015-07-29client_id -> public_keyirungentoo
2015-07-28client_id -> public_keyirungentoo
2015-07-27client_id -> public_keyirungentoo
2015-07-24Removed useless variable.irungentoo
2015-07-18Fixed bug.irungentoo
2015-07-15Added function to help calculate size of packet nodes.irungentoo
2015-07-14DHT_size now returns correct size for packed nodes.irungentoo
2015-07-14Use size define instead of sizeof.irungentoo
2015-07-12Pack DHT nodes in save.irungentoo
TODO: Make DHT_size return exact size of DHT save.
2015-06-27Removed some comented out code.irungentoo