diff options
author | irungentoo <irungentoo@gmail.com> | 2015-04-21 20:12:24 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2015-04-21 20:12:24 -0400 |
commit | 3bd4f5902cb4dd4301ba9a8433f073fe31d6d2b5 (patch) | |
tree | 8e570409b0a0660ee6c8cb6d87ef2e44636e81d6 /toxcore/friend_connection.h | |
parent | e1a98987ffeea04dd075be760af7621824fdc30a (diff) |
Move the send tcp relay packet from Messenger to friend connection.
Diffstat (limited to 'toxcore/friend_connection.h')
-rw-r--r-- | toxcore/friend_connection.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/toxcore/friend_connection.h b/toxcore/friend_connection.h index 641d2872..60b62646 100644 --- a/toxcore/friend_connection.h +++ b/toxcore/friend_connection.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #define GROUPCHAT_CALLBACK_INDEX 1 | 36 | #define GROUPCHAT_CALLBACK_INDEX 1 |
37 | 37 | ||
38 | #define PACKET_ID_ALIVE 16 | 38 | #define PACKET_ID_ALIVE 16 |
39 | #define PACKET_ID_SHARE_RELAYS 17 | ||
39 | #define PACKET_ID_FRIEND_REQUESTS 18 | 40 | #define PACKET_ID_FRIEND_REQUESTS 18 |
40 | 41 | ||
41 | /* Interval between the sending of ping packets. */ | 42 | /* Interval between the sending of ping packets. */ |
@@ -49,6 +50,13 @@ | |||
49 | 50 | ||
50 | #define FRIEND_MAX_STORED_TCP_RELAYS (MAX_FRIEND_TCP_CONNECTIONS * 4) | 51 | #define FRIEND_MAX_STORED_TCP_RELAYS (MAX_FRIEND_TCP_CONNECTIONS * 4) |
51 | 52 | ||
53 | /* Max number of tcp relays sent to friends */ | ||
54 | #define MAX_SHARED_RELAYS (RECOMMENDED_FRIEND_TCP_CONNECTIONS) | ||
55 | |||
56 | /* Interval between the sending of tcp relay information */ | ||
57 | #define SHARE_RELAYS_INTERVAL (5 * 60) | ||
58 | |||
59 | |||
52 | enum { | 60 | enum { |
53 | FRIENDCONN_STATUS_NONE, | 61 | FRIENDCONN_STATUS_NONE, |
54 | FRIENDCONN_STATUS_CONNECTING, | 62 | FRIENDCONN_STATUS_CONNECTING, |
@@ -68,6 +76,7 @@ typedef struct { | |||
68 | int crypt_connection_id; | 76 | int crypt_connection_id; |
69 | 77 | ||
70 | uint64_t ping_lastrecv, ping_lastsent; | 78 | uint64_t ping_lastrecv, ping_lastsent; |
79 | uint64_t share_relays_lastsent; | ||
71 | 80 | ||
72 | struct { | 81 | struct { |
73 | int (*status_callback)(void *object, int id, uint8_t status); | 82 | int (*status_callback)(void *object, int id, uint8_t status); |