summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/clientloop.c b/clientloop.c
index 75daea816..8f4b6e1b0 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -565,16 +565,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
565static void 565static void
566server_alive_check(void) 566server_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/*
@@ -634,7 +639,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
634 */ 639 */
635 640
636 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ 641 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */
637 if (options.server_alive_interval > 0 && compat20) 642 if (options.server_alive_interval > 0)
638 timeout_secs = options.server_alive_interval; 643 timeout_secs = options.server_alive_interval;
639 set_control_persist_exit_time(); 644 set_control_persist_exit_time();
640 if (control_persist_exit_time > 0) { 645 if (control_persist_exit_time > 0) {
@@ -1646,8 +1651,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1646 exit_status = 0; 1651 exit_status = 0;
1647 } 1652 }
1648 1653
1649 if (received_signal) 1654 if (received_signal) {
1650 fatal("Killed by signal %d.", (int) received_signal); 1655 debug("Killed by signal %d.", (int) received_signal);
1656 cleanup_exit((int) received_signal + 128);
1657 }
1651 1658
1652 /* 1659 /*
1653 * In interactive mode (with pseudo tty) display a message indicating 1660 * In interactive mode (with pseudo tty) display a message indicating