diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/clientloop.c b/clientloop.c index 7bb63c73b..5b76b9893 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -565,16 +565,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
565 | static void | 565 | static void |
566 | server_alive_check(void) | 566 | server_alive_check(void) |
567 | { | 567 | { |
568 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | 568 | if (compat20) { |
569 | logit("Timeout, server %s not responding.", host); | 569 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { |
570 | cleanup_exit(255); | 570 | logit("Timeout, server %s not responding.", host); |
571 | cleanup_exit(255); | ||
572 | } | ||
573 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
574 | packet_put_cstring("keepalive@openssh.com"); | ||
575 | packet_put_char(1); /* boolean: want reply */ | ||
576 | packet_send(); | ||
577 | /* Insert an empty placeholder to maintain ordering */ | ||
578 | client_register_global_confirm(NULL, NULL); | ||
579 | } else { | ||
580 | packet_send_ignore(0); | ||
581 | packet_send(); | ||
571 | } | 582 | } |
572 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
573 | packet_put_cstring("keepalive@openssh.com"); | ||
574 | packet_put_char(1); /* boolean: want reply */ | ||
575 | packet_send(); | ||
576 | /* Insert an empty placeholder to maintain ordering */ | ||
577 | client_register_global_confirm(NULL, NULL); | ||
578 | } | 583 | } |
579 | 584 | ||
580 | /* | 585 | /* |
@@ -636,7 +641,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
636 | */ | 641 | */ |
637 | 642 | ||
638 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ | 643 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ |
639 | if (options.server_alive_interval > 0 && compat20) | 644 | if (options.server_alive_interval > 0) |
640 | timeout_secs = options.server_alive_interval; | 645 | timeout_secs = options.server_alive_interval; |
641 | set_control_persist_exit_time(); | 646 | set_control_persist_exit_time(); |
642 | if (control_persist_exit_time > 0) { | 647 | if (control_persist_exit_time > 0) { |
@@ -1650,8 +1655,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1650 | exit_status = 0; | 1655 | exit_status = 0; |
1651 | } | 1656 | } |
1652 | 1657 | ||
1653 | if (received_signal) | 1658 | if (received_signal) { |
1654 | fatal("Killed by signal %d.", (int) received_signal); | 1659 | debug("Killed by signal %d.", (int) received_signal); |
1660 | cleanup_exit((int) received_signal + 128); | ||
1661 | } | ||
1655 | 1662 | ||
1656 | /* | 1663 | /* |
1657 | * In interactive mode (with pseudo tty) display a message indicating | 1664 | * In interactive mode (with pseudo tty) display a message indicating |