mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed useless inbound connection not timing out.
This commit is contained in:
parent
41d31e9802
commit
f3dfeb607b
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user