summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/clientloop.c b/clientloop.c
index 5c2b7217f..5653cc489 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -578,21 +578,16 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
578static void 578static void
579server_alive_check(void) 579server_alive_check(void)
580{ 580{
581 if (compat20) { 581 if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
582 if (packet_inc_alive_timeouts() > options.server_alive_count_max) { 582 logit("Timeout, server %s not responding.", host);
583 logit("Timeout, server %s not responding.", host); 583 cleanup_exit(255);
584 cleanup_exit(255);
585 }
586 packet_start(SSH2_MSG_GLOBAL_REQUEST);
587 packet_put_cstring("keepalive@openssh.com");
588 packet_put_char(1); /* boolean: want reply */
589 packet_send();
590 /* Insert an empty placeholder to maintain ordering */
591 client_register_global_confirm(NULL, NULL);
592 } else {
593 packet_send_ignore(0);
594 packet_send();
595 } 584 }
585 packet_start(SSH2_MSG_GLOBAL_REQUEST);
586 packet_put_cstring("keepalive@openssh.com");
587 packet_put_char(1); /* boolean: want reply */
588 packet_send();
589 /* Insert an empty placeholder to maintain ordering */
590 client_register_global_confirm(NULL, NULL);
596} 591}
597 592
598/* 593/*
@@ -654,7 +649,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
654 */ 649 */
655 650
656 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ 651 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */
657 if (options.server_alive_interval > 0) { 652 if (options.server_alive_interval > 0 && compat20) {
658 timeout_secs = options.server_alive_interval; 653 timeout_secs = options.server_alive_interval;
659 server_alive_time = now + options.server_alive_interval; 654 server_alive_time = now + options.server_alive_interval;
660 } 655 }