summaryrefslogtreecommitdiff
path: root/toxcore/friend_connection.c
AgeCommit message (Collapse)Author
2020-05-04Add logging to TCP and onion client.iphydf
2020-03-14Use spdx license identifier instead of GPL blurb.iphydf
2018-11-29Implement conferences savingzugz (tox)
* add global friend_connection status callback, used for group rejoining * stop leaving groups on killing tox
2018-08-26Update copyright to 2018.iphydf
2018-08-16Use per-instance `Mono_Time` for Messenger and onion.iphydf
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
It turns out, `unix_time` is also monotonic, and is used as such, so I've renamed the new functions to `mono_time_*`. 2018-07-08: ``` 00:01 <@irungentoo> the idea used to be that the unix_time() function could go backward in time but I think I might have started using it like if it could not after I changed it so that it would never go back in time ```
2018-07-08Use named function types for friend_connection callbacks.iphydf
Also: * No inner structs. * One declarator per member declaration. * Function names are snake_case. * Names ending in `_cb` are function types. * `++i` is preferred over `i++`.
2018-07-05Make tox.c unambiguously parseable.iphydf
Rules: 1. Constants are uppercase names: THE_CONSTANT. 2. SUE[1] types start with an uppercase letter and have at least one lowercase letter in it: The_Type, THE_Type. 3. Function types end in "_cb": tox_friend_connection_cb. 4. Variable and function names are all lowercase: the_function. This makes it easier for humans reading the code to determine what an identifier means. I'm not convinced by the enum type name change, but I don't know a better rule. Currently, a lot of enum types are spelled like constants, which is confusing. [1] struct/union/enum
2018-05-20Finish @Diadlo's network Family abstraction.iphydf
The Family stuff in toxcore is a big mess. I'm sure I saw a bunch of bugs on the way, but I'm not verifying that code now, so the bugs stay.
2018-05-20Move system header includes from network.h to network.ciphydf
2018-02-18Use `const` more in C code.iphydf
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2018-01-16Use apidsl to generate LAN_discovery.h.iphydf
2018-01-14Make Friend_Connections a module-private type.iphydf
2018-01-14Make Onion_Client a module-private type.iphydf
2018-01-10Fix formatting in some C files.iphydf
Also replace &(x) with &x for consistency.
2017-11-20forget DHT pubkey of offline friend after DHT timeoutzugz
2017-10-04Improve LAN discoveryDiadlo
Issue: If another tox instance started on the not default port, LAN discovery will be failed. Now tox will iterate though all possible ports to find another tox instances.
2017-08-24AF_INET -> TOX_AF_INETDiadlo
2017-02-26Add part of platform-independent network API implementationDiadlo
socket -> net_socket htons -> net_htons htonl -> net_htonl connect -> net_connect sendto -> net_sendto_ip4 getaddrinfo -> net_getipport sa_family_t -> Family
2017-01-28Add VLA compatibility macro for C89-ish compilers.iphydf
2017-01-19Update license headers and remove redundant file name comment.iphydf
"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".
2016-12-22Wrap all sodium/nacl functions in crypto_core.c.iphydf
2016-12-14Add option to disable local peer discoveryMaxim Biro
2016-09-27Remove redundant callback objects.iphydf
These three objects and their callback IDs are always the same.
2016-09-24Make toxcore code C++ compatible.iphydf
It is still C code, so still compatible with C compilers as well. This change lets us see more clearly where implicit conversions occur by making them explicit.
2016-09-13Use <stdbool.h> and replace _Bool with bool.iphydf
This header is a requirement for the public API, therefore is assumed to exist. It is a C99 standard library header, and _Bool is not intended to be used directly, except in legacy code that defines bool (and true/false) itself. We don't use or depend on such code. None of our client code uses or depends on such code. There is no reason to not use bool.
2016-09-13Group #include directives in 3-4 groups.iphydf
1. Current module (if C file). 2. Headers from current library. 3. Headers from other library (e.g. toxcore includes in toxav). 4. System headers.
2016-09-10make the majority of the callbacks stateless and add some status to a testcasemichael bishop
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-05Make packet data a ptr-to-const.iphydf
Ensure that nobody inadvertly modifies the temporary packet data buffer.
2016-09-02Do not use `else` after `return`.iphydf
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-08-31Add braces to all if statements.iphydf
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
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
2015-06-15Fixed warning.irungentoo
2015-05-19Some fixes.irungentoo
2015-05-18If we get the ip/port of a relay on a local ip, assume that our friendirungentoo
is hosting a relay on his ip.
2015-05-04Fixed possible connection issue.irungentoo
2015-04-27Move LAN discovery from Messenger to friend_connection.irungentoo
2015-04-26Fixed one case of the connection callback not getting called on reconnection.irungentoo
2015-04-21Move the send tcp relay packet from Messenger to friend connection.irungentoo
2015-04-18Some changes to net crypto.irungentoo
Should fix certain connection issues that sometimes happen. The dht public key of the peer must be known to create the connection. If the dht pk of the peer changes when a connection is active, it is killed to make way for the new one.
2015-04-16Store TCP relays tied to friend and reconnect to some when reconnecting.irungentoo
2015-04-03Fixed offline callback being called when connection timed out and diedirungentoo
without ever actually being connected.
2014-12-25Fixed bug.irungentoo
Set friend in onion as offline when friend goes offline.
2014-12-11Fixed crash when connection was killed during the packet callback.irungentoo
2014-12-02Only copy when pointer isn't NULL in get_friendcon_public_keys().irungentoo
2014-11-21Cleaned up packet length types in toxcore.irungentoo
They are now all uint16_t instead of sometimes being uint32_t. Replaced some other uint32_t with unsigned ints.
2014-10-04Send friend request with connection if for some reason (groupchats) weirungentoo
are already connected to the friend but they have not added us yet.