mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed some possible ways connections could linger indefinitely without being killed.
This commit is contained in:
parent
b451565f17
commit
d058a59ccf
|
@ -1083,6 +1083,9 @@ static void do_new(Lossless_UDP *ludp)
|
||||||
|
|
||||||
if (tmp->status != LUDP_NO_CONNECTION && tmp->killat < temp_time)
|
if (tmp->status != LUDP_NO_CONNECTION && tmp->killat < temp_time)
|
||||||
tmp->status = LUDP_TIMED_OUT;
|
tmp->status = LUDP_TIMED_OUT;
|
||||||
|
|
||||||
|
if (tmp->inbound == LUDP_CONNECTION_INBOUND && tmp->status == LUDP_TIMED_OUT)
|
||||||
|
kill_connection(ludp, tmp_i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2140,6 +2140,8 @@ void do_inbound(Messenger *m)
|
||||||
accept_crypto_inbound(m->net_crypto, inconnection, public_key, secret_nonce, session_key);
|
accept_crypto_inbound(m->net_crypto, inconnection, public_key, secret_nonce, session_key);
|
||||||
|
|
||||||
set_friend_status(m, friend_id, FRIEND_CONFIRMED);
|
set_friend_status(m, friend_id, FRIEND_CONFIRMED);
|
||||||
|
} else {
|
||||||
|
kill_connection(m->net_crypto->lossless_udp, inconnection);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -573,7 +573,11 @@ int crypto_inbound(Net_Crypto *c, uint8_t *public_key, uint8_t *secret_nonce, ui
|
||||||
|
|
||||||
if (handle_cryptohandshake(c, public_key, secret_nonce, session_key, temp_data, len)) {
|
if (handle_cryptohandshake(c, public_key, secret_nonce, session_key, temp_data, len)) {
|
||||||
return incoming_con;
|
return incoming_con;
|
||||||
|
} else {
|
||||||
|
kill_connection(c->lossless_udp, incoming_con);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
kill_connection(c->lossless_udp, incoming_con);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user