comparison common-session.c @ 926:b8208506322e

Use AUTH_TIMEOUT only before authdone != 1. While at it, fix a few indentations and typo.
author Yousong Zhou <yszhou4tech@gmail.com>
date Thu, 13 Mar 2014 16:28:16 +0800
parents a1a97e98b0c1
children 122fb3532038
comparison
equal deleted inserted replaced
923:25b7ed9fe854 926:b8208506322e
431 /* determine the minimum timeout that might be required, so 431 /* determine the minimum timeout that might be required, so
432 as to avoid waking when unneccessary */ 432 as to avoid waking when unneccessary */
433 long ret = LONG_MAX; 433 long ret = LONG_MAX;
434 if (KEX_REKEY_TIMEOUT > 0) 434 if (KEX_REKEY_TIMEOUT > 0)
435 ret = MIN(KEX_REKEY_TIMEOUT, ret); 435 ret = MIN(KEX_REKEY_TIMEOUT, ret);
436 if (AUTH_TIMEOUT > 0) 436 /* AUTH_TIMEOUT is only relevant before authdone */
437 if (sess.authstate.authdone != 1 && AUTH_TIMEOUT > 0)
437 ret = MIN(AUTH_TIMEOUT, ret); 438 ret = MIN(AUTH_TIMEOUT, ret);
438 if (opts.keepalive_secs > 0) 439 if (opts.keepalive_secs > 0)
439 ret = MIN(opts.keepalive_secs, ret); 440 ret = MIN(opts.keepalive_secs, ret);
440 if (opts.idle_timeout_secs > 0) 441 if (opts.idle_timeout_secs > 0)
441 ret = MIN(opts.idle_timeout_secs, ret); 442 ret = MIN(opts.idle_timeout_secs, ret);
442 return ret; 443 return ret;
443 } 444 }
444 445
445 const char* get_user_shell() { 446 const char* get_user_shell() {
446 /* an empty shell should be interpreted as "/bin/sh" */ 447 /* an empty shell should be interpreted as "/bin/sh" */