From 3bd4f5902cb4dd4301ba9a8433f073fe31d6d2b5 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Tue, 21 Apr 2015 20:12:24 -0400 Subject: Move the send tcp relay packet from Messenger to friend connection. --- toxcore/friend_connection.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'toxcore/friend_connection.h') 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 @@ #define GROUPCHAT_CALLBACK_INDEX 1 #define PACKET_ID_ALIVE 16 +#define PACKET_ID_SHARE_RELAYS 17 #define PACKET_ID_FRIEND_REQUESTS 18 /* Interval between the sending of ping packets. */ @@ -49,6 +50,13 @@ #define FRIEND_MAX_STORED_TCP_RELAYS (MAX_FRIEND_TCP_CONNECTIONS * 4) +/* Max number of tcp relays sent to friends */ +#define MAX_SHARED_RELAYS (RECOMMENDED_FRIEND_TCP_CONNECTIONS) + +/* Interval between the sending of tcp relay information */ +#define SHARE_RELAYS_INTERVAL (5 * 60) + + enum { FRIENDCONN_STATUS_NONE, FRIENDCONN_STATUS_CONNECTING, @@ -68,6 +76,7 @@ typedef struct { int crypt_connection_id; uint64_t ping_lastrecv, ping_lastsent; + uint64_t share_relays_lastsent; struct { int (*status_callback)(void *object, int id, uint8_t status); -- cgit v1.2.3