Mercurial > dropbear
changeset 1292:432b0a030fd6
Avoid busy loop while waiting for rekey response
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 29 Apr 2016 23:04:10 +0800 |
parents | 4a4e5d823cf6 |
children | dc8f7997f10f |
files | common-session.c |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/common-session.c Tue Apr 12 21:22:21 2016 +0800 +++ b/common-session.c Fri Apr 29 23:04:10 2016 +0800 @@ -550,10 +550,12 @@ 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 */