mirror of
https://github.com/clearml/dropbear
synced 2025-06-08 15:37:58 +00:00
Use AUTH_TIMEOUT only before authdone != 1.
While at it, fix a few indentations and typo.
This commit is contained in:
parent
3e1a389629
commit
5baa10a6b6
@ -433,12 +433,13 @@ static long select_timeout() {
|
|||||||
long ret = LONG_MAX;
|
long ret = LONG_MAX;
|
||||||
if (KEX_REKEY_TIMEOUT > 0)
|
if (KEX_REKEY_TIMEOUT > 0)
|
||||||
ret = MIN(KEX_REKEY_TIMEOUT, ret);
|
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);
|
ret = MIN(AUTH_TIMEOUT, ret);
|
||||||
if (opts.keepalive_secs > 0)
|
if (opts.keepalive_secs > 0)
|
||||||
ret = MIN(opts.keepalive_secs, ret);
|
ret = MIN(opts.keepalive_secs, ret);
|
||||||
if (opts.idle_timeout_secs > 0)
|
if (opts.idle_timeout_secs > 0)
|
||||||
ret = MIN(opts.idle_timeout_secs, ret);
|
ret = MIN(opts.idle_timeout_secs, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
packet.c
4
packet.c
@ -87,12 +87,12 @@ void write_packet() {
|
|||||||
if (written < 0) {
|
if (written < 0) {
|
||||||
if (errno == EINTR) {
|
if (errno == EINTR) {
|
||||||
m_free(iov);
|
m_free(iov);
|
||||||
TRACE2(("leave writepacket: EINTR"))
|
TRACE2(("leave write_packet: EINTR"))
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
dropbear_exit("Error writing");
|
dropbear_exit("Error writing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (written == 0) {
|
if (written == 0) {
|
||||||
ses.remoteclosed();
|
ses.remoteclosed();
|
||||||
|
@ -52,7 +52,7 @@ void process_packet() {
|
|||||||
|
|
||||||
ses.lastpacket = type;
|
ses.lastpacket = type;
|
||||||
|
|
||||||
ses.last_packet_time = time(NULL);
|
ses.last_packet_time = time(NULL);
|
||||||
|
|
||||||
/* These packets we can receive at any time */
|
/* These packets we can receive at any time */
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user