summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c
index c7362caa8..ae93dcdf3 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -464,14 +464,19 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
464static void 464static void
465server_alive_check(void) 465server_alive_check(void)
466{ 466{
467 if (++server_alive_timeouts > options.server_alive_count_max) { 467 if (compat20) {
468 logit("Timeout, server not responding."); 468 if (++server_alive_timeouts > options.server_alive_count_max) {
469 cleanup_exit(255); 469 logit("Timeout, server not responding.");
470 cleanup_exit(255);
471 }
472 packet_start(SSH2_MSG_GLOBAL_REQUEST);
473 packet_put_cstring("keepalive@openssh.com");
474 packet_put_char(1); /* boolean: want reply */
475 packet_send();
476 } else {
477 packet_send_ignore(0);
478 packet_send();
470 } 479 }
471 packet_start(SSH2_MSG_GLOBAL_REQUEST);
472 packet_put_cstring("keepalive@openssh.com");
473 packet_put_char(1); /* boolean: want reply */
474 packet_send();
475} 480}
476 481
477/* 482/*
@@ -532,7 +537,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
532 * event pending. 537 * event pending.
533 */ 538 */
534 539
535 if (options.server_alive_interval == 0 || !compat20) 540 if (options.server_alive_interval == 0)
536 tvp = NULL; 541 tvp = NULL;
537 else { 542 else {
538 tv.tv_sec = options.server_alive_interval; 543 tv.tv_sec = options.server_alive_interval;
@@ -1549,8 +1554,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
1549 exit_status = 0; 1554 exit_status = 0;
1550 } 1555 }
1551 1556
1552 if (received_signal) 1557 if (received_signal) {
1553 fatal("Killed by signal %d.", (int) received_signal); 1558 debug("Killed by signal %d.", (int) received_signal);
1559 cleanup_exit((int) received_signal + 128);
1560 }
1554 1561
1555 /* 1562 /*
1556 * In interactive mode (with pseudo tty) display a message indicating 1563 * In interactive mode (with pseudo tty) display a message indicating