View | Details | Raw Unified | Return to bug 1712
Collapse All | Expand All

(-)clientloop.c (-11 / +16 lines)
Lines 502-517 client_global_request_reply(int type, u_ Link Here
502
static void
502
static void
503
server_alive_check(void)
503
server_alive_check(void)
504
{
504
{
505
	if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
505
	if (compat20) {
506
		logit("Timeout, server not responding.");
506
		if (packet_inc_alive_timeouts() > options.server_alive_count_max) {
507
		cleanup_exit(255);
507
			logit("Timeout, server not responding.");
508
	}
508
			cleanup_exit(255);
509
	packet_start(SSH2_MSG_GLOBAL_REQUEST);
509
		}
510
	packet_put_cstring("keepalive@openssh.com");
510
		packet_start(SSH2_MSG_GLOBAL_REQUEST);
511
	packet_put_char(1);     /* boolean: want reply */
511
		packet_put_cstring("keepalive@openssh.com");
512
	packet_send();
512
		packet_put_char(1);     /* boolean: want reply */
513
	/* Insert an empty placeholder to maintain ordering */
513
		packet_send();
514
	client_register_global_confirm(NULL, NULL);
514
		/* Insert an empty placeholder to maintain ordering */
515
		client_register_global_confirm(NULL, NULL);
516
	} else {
517
		packet_send_ignore(0);
518
		packet_send();
519
	}
515
}
520
}
516
521
517
/*
522
/*
Lines 572-578 client_wait_until_can_do_something(fd_se Link Here
572
	 * event pending.
577
	 * event pending.
573
	 */
578
	 */
574
579
575
	if (options.server_alive_interval == 0 || !compat20)
580
	if (options.server_alive_interval == 0)
576
		tvp = NULL;
581
		tvp = NULL;
577
	else {
582
	else {
578
		tv.tv_sec = options.server_alive_interval;
583
		tv.tv_sec = options.server_alive_interval;
(-)ssh_config.5 (-1 / +4 lines)
Lines 935-941 If, for example, Link Here
935
.Cm ServerAliveCountMax
935
.Cm ServerAliveCountMax
936
is left at the default, if the server becomes unresponsive,
936
is left at the default, if the server becomes unresponsive,
937
ssh will disconnect after approximately 45 seconds.
937
ssh will disconnect after approximately 45 seconds.
938
This option applies to protocol version 2 only.
938
This option applies to protocol version 2 only; in protocol version
939
1 there is no mechanism to request a response from the server to the
940
server alive messages, so disconnection is the responsibility of the TCP
941
stack.
939
.It Cm ServerAliveInterval
942
.It Cm ServerAliveInterval
940
Sets a timeout interval in seconds after which if no data has been received
943
Sets a timeout interval in seconds after which if no data has been received
941
from the server,
944
from the server,

Return to bug 1712