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 86695cc16..35550eb4d 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -563,16 +563,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
563static void 563static void
564server_alive_check(void) 564server_alive_check(void)
565{ 565{
566 if (packet_inc_alive_timeouts() > options.server_alive_count_max) { 566 if (compat20) {
567 logit("Timeout, server %s not responding.", host); 567 if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
568 cleanup_exit(255); 568 logit("Timeout, server %s not responding.", host);
569 cleanup_exit(255);
570 }
571 packet_start(SSH2_MSG_GLOBAL_REQUEST);
572 packet_put_cstring("keepalive@openssh.com");
573 packet_put_char(1); /* boolean: want reply */
574 packet_send();
575 /* Insert an empty placeholder to maintain ordering */
576 client_register_global_confirm(NULL, NULL);
577 } else {
578 packet_send_ignore(0);
579 packet_send();
569 } 580 }
570 packet_start(SSH2_MSG_GLOBAL_REQUEST);
571 packet_put_cstring("keepalive@openssh.com");
572 packet_put_char(1); /* boolean: want reply */
573 packet_send();
574 /* Insert an empty placeholder to maintain ordering */
575 client_register_global_confirm(NULL, NULL);
576} 581}
577 582
578/* 583/*
@@ -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 server_alive_time = now + options.server_alive_interval; 644 server_alive_time = now + options.server_alive_interval;
640 } 645 }
@@ -1712,8 +1717,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1712 exit_status = 0; 1717 exit_status = 0;
1713 } 1718 }
1714 1719
1715 if (received_signal) 1720 if (received_signal) {
1716 fatal("Killed by signal %d.", (int) received_signal); 1721 debug("Killed by signal %d.", (int) received_signal);
1722 cleanup_exit((int) received_signal + 128);
1723 }
1717 1724
1718 /* 1725 /*
1719 * In interactive mode (with pseudo tty) display a message indicating 1726 * In interactive mode (with pseudo tty) display a message indicating