mirror of
https://github.com/clearml/dropbear
synced 2025-02-07 13:21:15 +00:00
Avoid busy loop while waiting for rekey response
This commit is contained in:
parent
a453b06168
commit
8174300429
@ -550,10 +550,12 @@ static void update_timeout(long limit, long now, long last_event, long * timeout
|
||||
static long select_timeout() {
|
||||
/* determine the minimum timeout that might be required, so
|
||||
as to avoid waking when unneccessary */
|
||||
long timeout = LONG_MAX;
|
||||
long timeout = KEX_REKEY_TIMEOUT;
|
||||
long now = monotonic_now();
|
||||
|
||||
update_timeout(KEX_REKEY_TIMEOUT, now, ses.kexstate.lastkextime, &timeout);
|
||||
if (!ses.kexstate.sentkexinit) {
|
||||
update_timeout(KEX_REKEY_TIMEOUT, now, ses.kexstate.lastkextime, &timeout);
|
||||
}
|
||||
|
||||
if (ses.authstate.authdone != 1 && IS_DROPBEAR_SERVER) {
|
||||
/* AUTH_TIMEOUT is only relevant before authdone */
|
||||
|
Loading…
Reference in New Issue
Block a user