summaryrefslogtreecommitdiff
path: root/serverloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'serverloop.c')
-rw-r--r--serverloop.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/serverloop.c b/serverloop.c
index f7bbdad07..0b0f386d9 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: serverloop.c,v 1.160 2011/05/15 08:09:01 djm Exp $ */ 1/* $OpenBSD: serverloop.c,v 1.162 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
@@ -281,9 +281,18 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
281{ 281{
282 struct timeval tv, *tvp; 282 struct timeval tv, *tvp;
283 int ret; 283 int ret;
284 time_t minwait_secs = 0;
284 int client_alive_scheduled = 0; 285 int client_alive_scheduled = 0;
285 int program_alive_scheduled = 0; 286 int program_alive_scheduled = 0;
286 287
288 /* Allocate and update select() masks for channel descriptors. */
289 channel_prepare_select(readsetp, writesetp, maxfdp, nallocp,
290 &minwait_secs, 0);
291
292 if (minwait_secs != 0)
293 max_time_milliseconds = MIN(max_time_milliseconds,
294 (u_int)minwait_secs * 1000);
295
287 /* 296 /*
288 * if using client_alive, set the max timeout accordingly, 297 * if using client_alive, set the max timeout accordingly,
289 * and indicate that this particular timeout was for client 298 * and indicate that this particular timeout was for client
@@ -298,9 +307,6 @@ wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, int *maxfdp,
298 max_time_milliseconds = options.client_alive_interval * 1000; 307 max_time_milliseconds = options.client_alive_interval * 1000;
299 } 308 }
300 309
301 /* Allocate and update select() masks for channel descriptors. */
302 channel_prepare_select(readsetp, writesetp, maxfdp, nallocp, 0);
303
304 if (compat20) { 310 if (compat20) {
305#if 0 311#if 0
306 /* wrong: bad condition XXX */ 312 /* wrong: bad condition XXX */