summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/clientloop.c b/clientloop.c
index 7df941375..156a196dc 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -564,16 +564,21 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
564static void 564static void
565server_alive_check(void) 565server_alive_check(void)
566{ 566{
567 if (packet_inc_alive_timeouts() > options.server_alive_count_max) { 567 if (compat20) {
568 logit("Timeout, server %s not responding.", host); 568 if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
569 cleanup_exit(255); 569 logit("Timeout, server %s not responding.", host);
570 cleanup_exit(255);
571 }
572 packet_start(SSH2_MSG_GLOBAL_REQUEST);
573 packet_put_cstring("keepalive@openssh.com");
574 packet_put_char(1); /* boolean: want reply */
575 packet_send();
576 /* Insert an empty placeholder to maintain ordering */
577 client_register_global_confirm(NULL, NULL);
578 } else {
579 packet_send_ignore(0);
580 packet_send();
570 } 581 }
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} 582}
578 583
579/* 584/*
@@ -635,7 +640,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
635 */ 640 */
636 641
637 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */ 642 timeout_secs = INT_MAX; /* we use INT_MAX to mean no timeout */
638 if (options.server_alive_interval > 0 && compat20) { 643 if (options.server_alive_interval > 0) {
639 timeout_secs = options.server_alive_interval; 644 timeout_secs = options.server_alive_interval;
640 server_alive_time = now + options.server_alive_interval; 645 server_alive_time = now + options.server_alive_interval;
641 } 646 }