diff --git a/core/Lossless_UDP.c b/core/Lossless_UDP.c index 9d31a53b..1f123eda 100644 --- a/core/Lossless_UDP.c +++ b/core/Lossless_UDP.c @@ -198,7 +198,8 @@ int new_inconnection(IP_Port ip_port) connections[i].SYNC_rate = SYNC_RATE; connections[i].data_rate = DATA_SYNC_RATE; connections[i].last_recv = current_time(); - connections[i].killat = ~0; + //if this connection isn't handled within 5 seconds, kill it + connections[i].killat = current_time() + 1000000UL*CONNEXION_TIMEOUT; connections[i].send_counter = 127; return i; } diff --git a/core/net_crypto.c b/core/net_crypto.c index 2af5239b..faeb6be6 100644 --- a/core/net_crypto.c +++ b/core/net_crypto.c @@ -660,6 +660,9 @@ static void receive_crypto() { increment_nonce(crypto_connections[i].recv_nonce); crypto_connections[i].status = 3; + + //connection is accepted so we disable the auto kill by setting it to about 1 month from now. + kill_connection_in(crypto_connections[i].number, 3000000); } else {