mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Only send kill packet when killing established connection.
This commit is contained in:
parent
ab4673e873
commit
6dcd90a116
|
@ -2475,7 +2475,9 @@ int crypto_kill(Net_Crypto *c, int crypt_connection_id)
|
||||||
if (conn == 0)
|
if (conn == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
send_kill_packet(c, crypt_connection_id);
|
if (conn->status == CRYPTO_CONN_ESTABLISHED)
|
||||||
|
send_kill_packet(c, crypt_connection_id);
|
||||||
|
|
||||||
disconnect_peer_tcp(c, crypt_connection_id);
|
disconnect_peer_tcp(c, crypt_connection_id);
|
||||||
bs_list_remove(&c->ip_port_list, &conn->ip_port, crypt_connection_id);
|
bs_list_remove(&c->ip_port_list, &conn->ip_port, crypt_connection_id);
|
||||||
return wipe_crypto_connection(c, crypt_connection_id);
|
return wipe_crypto_connection(c, crypt_connection_id);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user