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 ed1902363..97032e6a8 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -547,16 +547,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
547static void 547static void
548server_alive_check(void) 548server_alive_check(void)
549{ 549{
550 if (packet_inc_alive_timeouts() > options.server_alive_count_max) { 550 if (compat20) {
551 logit("Timeout, server %s not responding.", host); 551 if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
552 cleanup_exit(255); 552 logit("Timeout, server %s not responding.", host);
553 cleanup_exit(255);
554 }
555 packet_start(SSH2_MSG_GLOBAL_REQUEST);
556 packet_put_cstring("keepalive@openssh.com");
557 packet_put_char(1); /* boolean: want reply */
558 packet_send();
559 /* Insert an empty placeholder to maintain ordering */
560 client_register_global_confirm(NULL, NULL);
561 } else {
562 packet_send_ignore(0);
563 packet_send();
553 } 564 }
554 packet_start(SSH2_MSG_GLOBAL_REQUEST);
555 packet_put_cstring("keepalive@openssh.com");
556 packet_put_char(1); /* boolean: want reply */
557 packet_send();
558 /* Insert an empty placeholder to maintain ordering */
559 client_register_global_confirm(NULL, NULL);
560} 565}
561 566
562/* 567/*
@@ -616,7 +621,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
616 */ 621 */
617 622
618 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ 623 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */
619 if (options.server_alive_interval > 0 && compat20) 624 if (options.server_alive_interval > 0)
620 timeout_secs = options.server_alive_interval; 625 timeout_secs = options.server_alive_interval;
621 set_control_persist_exit_time(); 626 set_control_persist_exit_time();
622 if (control_persist_exit_time > 0) { 627 if (control_persist_exit_time > 0) {
@@ -1589,8 +1594,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1589 exit_status = 0; 1594 exit_status = 0;
1590 } 1595 }
1591 1596
1592 if (received_signal) 1597 if (received_signal) {
1593 fatal("Killed by signal %d.", (int) received_signal); 1598 debug("Killed by signal %d.", (int) received_signal);
1599 cleanup_exit((int) received_signal + 128);
1600 }
1594 1601
1595 /* 1602 /*
1596 * In interactive mode (with pseudo tty) display a message indicating 1603 * In interactive mode (with pseudo tty) display a message indicating