summaryrefslogtreecommitdiff
path: root/toxcore/TCP_connection.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-04-16 15:17:47 -0400
committerirungentoo <irungentoo@gmail.com>2015-04-16 15:17:47 -0400
commit7d466fda2cb7108fb203e4e1b94f88187597a014 (patch)
tree75db1051441e071c07889b70ad9b40c73343a9a0 /toxcore/TCP_connection.h
parent565d73713aa75f0d5437f0152ee7cb22f3113c59 (diff)
Only increase connection lock if connection is actively used to connect
to a friend. Give the connection a couple seconds (TCP_CONNECTION_ANNOUNCE_TIMEOUT) to connect itself to the friend before killing it if we are already connected to enough total relays.
Diffstat (limited to 'toxcore/TCP_connection.h')
-rw-r--r--toxcore/TCP_connection.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/toxcore/TCP_connection.h b/toxcore/TCP_connection.h
index 2c86304f..10c7198e 100644
--- a/toxcore/TCP_connection.h
+++ b/toxcore/TCP_connection.h
@@ -36,6 +36,8 @@
36 36
37#define MAX_FRIEND_TCP_CONNECTIONS 4 37#define MAX_FRIEND_TCP_CONNECTIONS 4
38 38
39/* Time until connection to friend gets killed (if it doesn't get locked withing that time) */
40#define TCP_CONNECTION_ANNOUNCE_TIMEOUT (TCP_CONNECTION_TIMEOUT)
39 41
40typedef struct { 42typedef struct {
41 uint8_t status; 43 uint8_t status;
@@ -53,6 +55,7 @@ typedef struct {
53typedef struct { 55typedef struct {
54 uint8_t status; 56 uint8_t status;
55 TCP_Client_Connection *connection; 57 TCP_Client_Connection *connection;
58 uint64_t connected_time;
56 uint32_t lock_count; 59 uint32_t lock_count;
57} TCP_con; 60} TCP_con;
58 61