Fixed bug in Lossless UDP.

This commit is contained in:
irungentoo 2013-09-19 09:46:55 -04:00
parent e2e2719439
commit 993554bdf6

View File

@ -170,6 +170,7 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port)
memset(connection, 0, sizeof(Connection)); memset(connection, 0, sizeof(Connection));
uint32_t handshake_id1 = handshake_id(ludp, ip_port); uint32_t handshake_id1 = handshake_id(ludp, ip_port);
uint64_t timeout = CONNEXION_TIMEOUT + rand() % CONNEXION_TIMEOUT;
*connection = (Connection) { *connection = (Connection) {
.ip_port = ip_port, .ip_port = ip_port,
@ -186,7 +187,7 @@ int new_connection(Lossless_UDP *ludp, IP_Port ip_port)
.killat = ~0, .killat = ~0,
.send_counter = 0, .send_counter = 0,
/* add randomness to timeout to prevent connections getting stuck in a loop. */ /* add randomness to timeout to prevent connections getting stuck in a loop. */
.timeout = CONNEXION_TIMEOUT + rand() % CONNEXION_TIMEOUT .timeout = timeout
}; };
return connection_id; return connection_id;