diff options
Diffstat (limited to 'serverloop.c')
-rw-r--r-- | serverloop.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/serverloop.c b/serverloop.c index 0c75b05c9..39d992057 100644 --- a/serverloop.c +++ b/serverloop.c | |||
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: serverloop.c,v 1.93 2001/12/28 15:06:00 markus Exp $"); | 38 | RCSID("$OpenBSD: serverloop.c,v 1.94 2002/01/10 11:13:29 markus Exp $"); |
39 | 39 | ||
40 | #include "xmalloc.h" | 40 | #include "xmalloc.h" |
41 | #include "packet.h" | 41 | #include "packet.h" |
@@ -209,15 +209,21 @@ make_packets_from_stdout_data(void) | |||
209 | static void | 209 | static void |
210 | client_alive_check(void) | 210 | client_alive_check(void) |
211 | { | 211 | { |
212 | static int had_channel = 0; | ||
212 | int id; | 213 | int id; |
213 | 214 | ||
215 | id = channel_find_open(); | ||
216 | if (id == -1) { | ||
217 | if (!had_channel) | ||
218 | return; | ||
219 | packet_disconnect("No open channels after timeout!"); | ||
220 | } | ||
221 | had_channel = 1; | ||
222 | |||
214 | /* timeout, check to see how many we have had */ | 223 | /* timeout, check to see how many we have had */ |
215 | if (++client_alive_timeouts > options.client_alive_count_max) | 224 | if (++client_alive_timeouts > options.client_alive_count_max) |
216 | packet_disconnect("Timeout, your session not responding."); | 225 | packet_disconnect("Timeout, your session not responding."); |
217 | 226 | ||
218 | id = channel_find_open(); | ||
219 | if (id == -1) | ||
220 | packet_disconnect("No open channels after timeout!"); | ||
221 | /* | 227 | /* |
222 | * send a bogus channel request with "wantreply", | 228 | * send a bogus channel request with "wantreply", |
223 | * we should get back a failure | 229 | * we should get back a failure |