# HG changeset patch # User Yousong Zhou # Date 1394699296 -28800 # Node ID b8208506322ef963cfc5c52a15129038df4169ab # Parent 25b7ed9fe8546bbaeeaa3351cb3bc9a85441bad4 Use AUTH_TIMEOUT only before authdone != 1. While at it, fix a few indentations and typo. diff -r 25b7ed9fe854 -r b8208506322e common-session.c --- a/common-session.c Sat Mar 08 21:00:57 2014 +0800 +++ b/common-session.c Thu Mar 13 16:28:16 2014 +0800 @@ -433,12 +433,13 @@ long ret = LONG_MAX; if (KEX_REKEY_TIMEOUT > 0) ret = MIN(KEX_REKEY_TIMEOUT, ret); - if (AUTH_TIMEOUT > 0) + /* AUTH_TIMEOUT is only relevant before authdone */ + if (sess.authstate.authdone != 1 && AUTH_TIMEOUT > 0) ret = MIN(AUTH_TIMEOUT, ret); if (opts.keepalive_secs > 0) ret = MIN(opts.keepalive_secs, ret); - if (opts.idle_timeout_secs > 0) - ret = MIN(opts.idle_timeout_secs, ret); + if (opts.idle_timeout_secs > 0) + ret = MIN(opts.idle_timeout_secs, ret); return ret; } diff -r 25b7ed9fe854 -r b8208506322e packet.c --- a/packet.c Sat Mar 08 21:00:57 2014 +0800 +++ b/packet.c Thu Mar 13 16:28:16 2014 +0800 @@ -87,12 +87,12 @@ if (written < 0) { if (errno == EINTR) { m_free(iov); - TRACE2(("leave writepacket: EINTR")) + TRACE2(("leave write_packet: EINTR")) return; } else { dropbear_exit("Error writing"); } - } + } if (written == 0) { ses.remoteclosed(); diff -r 25b7ed9fe854 -r b8208506322e process-packet.c --- a/process-packet.c Sat Mar 08 21:00:57 2014 +0800 +++ b/process-packet.c Thu Mar 13 16:28:16 2014 +0800 @@ -52,7 +52,7 @@ ses.lastpacket = type; - ses.last_packet_time = time(NULL); + ses.last_packet_time = time(NULL); /* These packets we can receive at any time */ switch(type) {