Skip to content

Commit

Permalink
Updating toxcore to 0.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
dvor committed Aug 22, 2017
1 parent ffcc11e commit a6be9d9
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 38 deletions.
2 changes: 1 addition & 1 deletion toxcore-git
2 changes: 1 addition & 1 deletion toxcore.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

Pod::Spec.new do |s|
s.name = "toxcore"
s.version = "0.1.9"
s.version = "0.1.10"
s.summary = "Cocoapods wrapper for toxcore"
s.homepage = "https://github.com/Antidote-for-Tox/toxcore"
s.license = 'GPLv3'
Expand Down
19 changes: 15 additions & 4 deletions toxcore/toxcore/onion_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#define MAX_ONION_CLIENTS 8
#define MAX_ONION_CLIENTS_ANNOUNCE 12 /* Number of nodes to announce ourselves to. */
#define ONION_NODE_PING_INTERVAL 15
#define ONION_NODE_TIMEOUT (ONION_NODE_PING_INTERVAL * 3)
#define ONION_NODE_TIMEOUT ONION_NODE_PING_INTERVAL

/* The interval in seconds at which to tell our friends where we are */
#define ONION_DHTPK_SEND_INTERVAL 30
Expand All @@ -50,12 +50,16 @@
#define MAX_STORED_PINGED_NODES 9
#define MIN_NODE_PING_TIME 10

#define ONION_NODE_MAX_PINGS 3

#define MAX_PATH_NODES 32

/* If no packets are received within that interval tox will
* be considered offline.
/* If no announce response packets are received within this interval tox will
* be considered offline. We give time for a node to be pinged often enough
* that it times out, which leads to the network being thoroughly tested as it
* is replaced.
*/
#define ONION_OFFLINE_TIMEOUT (ONION_NODE_PING_INTERVAL * 1.25)
#define ONION_OFFLINE_TIMEOUT (ONION_NODE_PING_INTERVAL * (ONION_NODE_MAX_PINGS+2))

/* Onion data packet ids. */
#define ONION_DATA_FRIEND_REQ CRYPTO_PACKET_FRIEND_REQ
Expand All @@ -68,10 +72,14 @@ typedef struct {
uint8_t data_public_key[CRYPTO_PUBLIC_KEY_SIZE];
uint8_t is_stored;

uint64_t added_time;

uint64_t timestamp;

uint64_t last_pinged;

uint8_t unsuccessful_pings;

uint32_t path_used;
} Onion_Node;

Expand Down Expand Up @@ -101,6 +109,8 @@ typedef struct {
uint8_t temp_public_key[CRYPTO_PUBLIC_KEY_SIZE];
uint8_t temp_secret_key[CRYPTO_SECRET_KEY_SIZE];

uint64_t last_reported_announced;

uint64_t last_dht_pk_onion_sent;
uint64_t last_dht_pk_dht_sent;

Expand Down Expand Up @@ -133,6 +143,7 @@ typedef struct {
uint16_t num_friends;

Onion_Node clients_announce_list[MAX_ONION_CLIENTS_ANNOUNCE];
uint64_t last_announce;

Onion_Client_Paths onion_paths_self;
Onion_Client_Paths onion_paths_friends;
Expand Down
Loading

0 comments on commit a6be9d9

Please sign in to comment.