diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/clientloop.c b/clientloop.c index 626b29a5a..a13d06ddf 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -324,12 +324,17 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
324 | static void | 324 | static void |
325 | server_alive_check(void) | 325 | server_alive_check(void) |
326 | { | 326 | { |
327 | if (++server_alive_timeouts > options.server_alive_count_max) | 327 | if (compat20) { |
328 | packet_disconnect("Timeout, server not responding."); | 328 | if (++server_alive_timeouts > options.server_alive_count_max) |
329 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | 329 | packet_disconnect("Timeout, server not responding."); |
330 | packet_put_cstring("keepalive@openssh.com"); | 330 | packet_start(SSH2_MSG_GLOBAL_REQUEST); |
331 | packet_put_char(1); /* boolean: want reply */ | 331 | packet_put_cstring("keepalive@openssh.com"); |
332 | packet_send(); | 332 | packet_put_char(1); /* boolean: want reply */ |
333 | packet_send(); | ||
334 | } else { | ||
335 | packet_send_ignore(0); | ||
336 | packet_send(); | ||
337 | } | ||
333 | } | 338 | } |
334 | 339 | ||
335 | /* | 340 | /* |
@@ -388,7 +393,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
388 | * event pending. | 393 | * event pending. |
389 | */ | 394 | */ |
390 | 395 | ||
391 | if (options.server_alive_interval == 0 || !compat20) | 396 | if (options.server_alive_interval == 0) |
392 | tvp = NULL; | 397 | tvp = NULL; |
393 | else { | 398 | else { |
394 | tv.tv_sec = options.server_alive_interval; | 399 | tv.tv_sec = options.server_alive_interval; |