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 47f3c7ecd..c9176c0d7 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -439,12 +439,17 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
439 | static void | 439 | static void |
440 | server_alive_check(void) | 440 | server_alive_check(void) |
441 | { | 441 | { |
442 | if (++server_alive_timeouts > options.server_alive_count_max) | 442 | if (compat20) { |
443 | packet_disconnect("Timeout, server not responding."); | 443 | if (++server_alive_timeouts > options.server_alive_count_max) |
444 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | 444 | packet_disconnect("Timeout, server not responding."); |
445 | packet_put_cstring("keepalive@openssh.com"); | 445 | packet_start(SSH2_MSG_GLOBAL_REQUEST); |
446 | packet_put_char(1); /* boolean: want reply */ | 446 | packet_put_cstring("keepalive@openssh.com"); |
447 | packet_send(); | 447 | packet_put_char(1); /* boolean: want reply */ |
448 | packet_send(); | ||
449 | } else { | ||
450 | packet_send_ignore(0); | ||
451 | packet_send(); | ||
452 | } | ||
448 | } | 453 | } |
449 | 454 | ||
450 | /* | 455 | /* |
@@ -505,7 +510,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
505 | * event pending. | 510 | * event pending. |
506 | */ | 511 | */ |
507 | 512 | ||
508 | if (options.server_alive_interval == 0 || !compat20) | 513 | if (options.server_alive_interval == 0) |
509 | tvp = NULL; | 514 | tvp = NULL; |
510 | else { | 515 | else { |
511 | tv.tv_sec = options.server_alive_interval; | 516 | tv.tv_sec = options.server_alive_interval; |