summaryrefslogtreecommitdiff
path: root/clientloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'clientloop.c')
-rw-r--r--clientloop.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/clientloop.c b/clientloop.c
index 1591215bd..d36d816de 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -334,12 +334,17 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
334static void 334static void
335server_alive_check(void) 335server_alive_check(void)
336{ 336{
337 if (++server_alive_timeouts > options.server_alive_count_max) 337 if (compat20) {
338 packet_disconnect("Timeout, server not responding."); 338 if (++server_alive_timeouts > options.server_alive_count_max)
339 packet_start(SSH2_MSG_GLOBAL_REQUEST); 339 packet_disconnect("Timeout, server not responding.");
340 packet_put_cstring("keepalive@openssh.com"); 340 packet_start(SSH2_MSG_GLOBAL_REQUEST);
341 packet_put_char(1); /* boolean: want reply */ 341 packet_put_cstring("keepalive@openssh.com");
342 packet_send(); 342 packet_put_char(1); /* boolean: want reply */
343 packet_send();
344 } else {
345 packet_send_ignore(0);
346 packet_send();
347 }
343} 348}
344 349
345/* 350/*
@@ -400,7 +405,7 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
400 * event pending. 405 * event pending.
401 */ 406 */
402 407
403 if (options.server_alive_interval == 0 || !compat20) 408 if (options.server_alive_interval == 0)
404 tvp = NULL; 409 tvp = NULL;
405 else { 410 else {
406 tv.tv_sec = options.server_alive_interval; 411 tv.tv_sec = options.server_alive_interval;