summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toxcore/Lossless_UDP.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index 46b0bed1..0ee9b890 100644
--- a/toxcore/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
@@ -170,6 +170,7 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port)
170 memset(connection, 0, sizeof(Connection)); 170 memset(connection, 0, sizeof(Connection));
171 171
172 uint32_t handshake_id1 = handshake_id(ludp, ip_port); 172 uint32_t handshake_id1 = handshake_id(ludp, ip_port);
173 uint64_t timeout = CONNEXION_TIMEOUT + rand() % CONNEXION_TIMEOUT;
173 174
174 *connection = (Connection) { 175 *connection = (Connection) {
175 .ip_port = ip_port, 176 .ip_port = ip_port,
@@ -186,7 +187,7 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port)
186 .killat = ~0, 187 .killat = ~0,
187 .send_counter = 0, 188 .send_counter = 0,
188 /* add randomness to timeout to prevent connections getting stuck in a loop. */ 189 /* add randomness to timeout to prevent connections getting stuck in a loop. */
189 .timeout = CONNEXION_TIMEOUT + rand() % CONNEXION_TIMEOUT 190 .timeout = timeout
190 }; 191 };
191 192
192 return connection_id; 193 return connection_id;