diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clientloop.c b/clientloop.c index 75daea816..7bb63c73b 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.238 2012/01/18 21:46:43 dtucker Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.240 2012/06/20 04:42:58 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -587,10 +587,12 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
587 | { | 587 | { |
588 | struct timeval tv, *tvp; | 588 | struct timeval tv, *tvp; |
589 | int timeout_secs; | 589 | int timeout_secs; |
590 | time_t minwait_secs = 0; | ||
590 | int ret; | 591 | int ret; |
591 | 592 | ||
592 | /* Add any selections by the channel mechanism. */ | 593 | /* Add any selections by the channel mechanism. */ |
593 | channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, rekeying); | 594 | channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, |
595 | &minwait_secs, rekeying); | ||
594 | 596 | ||
595 | if (!compat20) { | 597 | if (!compat20) { |
596 | /* Read from the connection, unless our buffers are full. */ | 598 | /* Read from the connection, unless our buffers are full. */ |
@@ -643,6 +645,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
643 | if (timeout_secs < 0) | 645 | if (timeout_secs < 0) |
644 | timeout_secs = 0; | 646 | timeout_secs = 0; |
645 | } | 647 | } |
648 | if (minwait_secs != 0) | ||
649 | timeout_secs = MIN(timeout_secs, (int)minwait_secs); | ||
646 | if (timeout_secs == INT_MAX) | 650 | if (timeout_secs == INT_MAX) |
647 | tvp = NULL; | 651 | tvp = NULL; |
648 | else { | 652 | else { |