summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/clientloop.c b/clientloop.c
index 8f4b6e1b0..5b76b9893 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
@@ -592,10 +592,12 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
592{ 592{
593 struct timeval tv, *tvp; 593 struct timeval tv, *tvp;
594 int timeout_secs; 594 int timeout_secs;
595 time_t minwait_secs = 0;
595 int ret; 596 int ret;
596 597
597 /* Add any selections by the channel mechanism. */ 598 /* Add any selections by the channel mechanism. */
598 channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, rekeying); 599 channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
600 &minwait_secs, rekeying);
599 601
600 if (!compat20) { 602 if (!compat20) {
601 /* Read from the connection, unless our buffers are full. */ 603 /* Read from the connection, unless our buffers are full. */
@@ -648,6 +650,8 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
648 if (timeout_secs < 0) 650 if (timeout_secs < 0)
649 timeout_secs = 0; 651 timeout_secs = 0;
650 } 652 }
653 if (minwait_secs != 0)
654 timeout_secs = MIN(timeout_secs, (int)minwait_secs);
651 if (timeout_secs == INT_MAX) 655 if (timeout_secs == INT_MAX)
652 tvp = NULL; 656 tvp = NULL;
653 else { 657 else {