diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/clientloop.c b/clientloop.c index 17628efb5..18a85c56c 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -545,16 +545,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
545 | static void | 545 | static void |
546 | server_alive_check(void) | 546 | server_alive_check(void) |
547 | { | 547 | { |
548 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { | 548 | if (compat20) { |
549 | logit("Timeout, server %s not responding.", host); | 549 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { |
550 | cleanup_exit(255); | 550 | logit("Timeout, server %s not responding.", host); |
551 | cleanup_exit(255); | ||
552 | } | ||
553 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
554 | packet_put_cstring("keepalive@openssh.com"); | ||
555 | packet_put_char(1); /* boolean: want reply */ | ||
556 | packet_send(); | ||
557 | /* Insert an empty placeholder to maintain ordering */ | ||
558 | client_register_global_confirm(NULL, NULL); | ||
559 | } else { | ||
560 | packet_send_ignore(0); | ||
561 | packet_send(); | ||
551 | } | 562 | } |
552 | packet_start(SSH2_MSG_GLOBAL_REQUEST); | ||
553 | packet_put_cstring("keepalive@openssh.com"); | ||
554 | packet_put_char(1); /* boolean: want reply */ | ||
555 | packet_send(); | ||
556 | /* Insert an empty placeholder to maintain ordering */ | ||
557 | client_register_global_confirm(NULL, NULL); | ||
558 | } | 563 | } |
559 | 564 | ||
560 | /* | 565 | /* |
@@ -614,7 +619,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp, | |||
614 | */ | 619 | */ |
615 | 620 | ||
616 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ | 621 | timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ |
617 | if (options.server_alive_interval > 0 && compat20) | 622 | if (options.server_alive_interval > 0) |
618 | timeout_secs = options.server_alive_interval; | 623 | timeout_secs = options.server_alive_interval; |
619 | set_control_persist_exit_time(); | 624 | set_control_persist_exit_time(); |
620 | if (control_persist_exit_time > 0) { | 625 | if (control_persist_exit_time > 0) { |
@@ -1614,8 +1619,10 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1614 | exit_status = 0; | 1619 | exit_status = 0; |
1615 | } | 1620 | } |
1616 | 1621 | ||
1617 | if (received_signal) | 1622 | if (received_signal) { |
1618 | fatal("Killed by signal %d.", (int) received_signal); | 1623 | debug("Killed by signal %d.", (int) received_signal); |
1624 | cleanup_exit((int) received_signal + 128); | ||
1625 | } | ||
1619 | 1626 | ||
1620 | /* | 1627 | /* |
1621 | * In interactive mode (with pseudo tty) display a message indicating | 1628 | * In interactive mode (with pseudo tty) display a message indicating |