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 2ef816ab3..1a16b2525 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/*
@@ -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) {
@@ -1705,8 +1710,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1705 exit_status = 0; 1710 exit_status = 0;
1706 } 1711 }
1707 1712
1708 if (received_signal) 1713 if (received_signal) {
1709 fatal("Killed by signal %d.", (int) received_signal); 1714 debug("Killed by signal %d.", (int) received_signal);
1715 cleanup_exit((int) received_signal + 128);
1716 }
1710 1717
1711 /* 1718 /*
1712 * In interactive mode (with pseudo tty) display a message indicating 1719 * In interactive mode (with pseudo tty) display a message indicating