diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/clientloop.c b/clientloop.c index cecc20915..cea0d617a 100644 --- a/clientloop.c +++ b/clientloop.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: clientloop.c,v 1.209 2009/02/12 03:00:56 djm Exp $ */ | 1 | /* $OpenBSD: clientloop.c,v 1.213 2009/07/05 19:28:33 stevesk Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -109,6 +109,7 @@ | |||
109 | #include "misc.h" | 109 | #include "misc.h" |
110 | #include "match.h" | 110 | #include "match.h" |
111 | #include "msg.h" | 111 | #include "msg.h" |
112 | #include "roaming.h" | ||
112 | 113 | ||
113 | #ifdef GSSAPI | 114 | #ifdef GSSAPI |
114 | #include "ssh-gss.h" | 115 | #include "ssh-gss.h" |
@@ -495,14 +496,14 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt) | |||
495 | xfree(gc); | 496 | xfree(gc); |
496 | } | 497 | } |
497 | 498 | ||
498 | keep_alive_timeouts = 0; | 499 | packet_set_alive_timeouts(0); |
499 | } | 500 | } |
500 | 501 | ||
501 | static void | 502 | static void |
502 | server_alive_check(void) | 503 | server_alive_check(void) |
503 | { | 504 | { |
504 | if (compat20) { | 505 | if (compat20) { |
505 | if (++keep_alive_timeouts > options.server_alive_count_max) { | 506 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { |
506 | logit("Timeout, server not responding."); | 507 | logit("Timeout, server not responding."); |
507 | cleanup_exit(255); | 508 | cleanup_exit(255); |
508 | } | 509 | } |
@@ -643,8 +644,8 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) | |||
643 | static void | 644 | static void |
644 | client_process_net_input(fd_set *readset) | 645 | client_process_net_input(fd_set *readset) |
645 | { | 646 | { |
646 | int len; | 647 | int len, cont = 0; |
647 | char buf[8192]; | 648 | char buf[SSH_IOBUFSZ]; |
648 | 649 | ||
649 | /* | 650 | /* |
650 | * Read input from the server, and add any such data to the buffer of | 651 | * Read input from the server, and add any such data to the buffer of |
@@ -652,8 +653,8 @@ client_process_net_input(fd_set *readset) | |||
652 | */ | 653 | */ |
653 | if (FD_ISSET(connection_in, readset)) { | 654 | if (FD_ISSET(connection_in, readset)) { |
654 | /* Read as much as possible. */ | 655 | /* Read as much as possible. */ |
655 | len = read(connection_in, buf, sizeof(buf)); | 656 | len = roaming_read(connection_in, buf, sizeof(buf), &cont); |
656 | if (len == 0) { | 657 | if (len == 0 && cont == 0) { |
657 | /* | 658 | /* |
658 | * Received EOF. The remote host has closed the | 659 | * Received EOF. The remote host has closed the |
659 | * connection. | 660 | * connection. |
@@ -1137,7 +1138,7 @@ static void | |||
1137 | client_process_input(fd_set *readset) | 1138 | client_process_input(fd_set *readset) |
1138 | { | 1139 | { |
1139 | int len; | 1140 | int len; |
1140 | char buf[8192]; | 1141 | char buf[SSH_IOBUFSZ]; |
1141 | 1142 | ||
1142 | /* Read input from stdin. */ | 1143 | /* Read input from stdin. */ |
1143 | if (FD_ISSET(fileno(stdin), readset)) { | 1144 | if (FD_ISSET(fileno(stdin), readset)) { |
@@ -1494,6 +1495,14 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1494 | /* Stop watching for window change. */ | 1495 | /* Stop watching for window change. */ |
1495 | signal(SIGWINCH, SIG_DFL); | 1496 | signal(SIGWINCH, SIG_DFL); |
1496 | 1497 | ||
1498 | if (compat20) { | ||
1499 | packet_start(SSH2_MSG_DISCONNECT); | ||
1500 | packet_put_int(SSH2_DISCONNECT_BY_APPLICATION); | ||
1501 | packet_put_cstring("disconnected by user"); | ||
1502 | packet_send(); | ||
1503 | packet_write_wait(); | ||
1504 | } | ||
1505 | |||
1497 | channel_free_all(); | 1506 | channel_free_all(); |
1498 | 1507 | ||
1499 | if (have_pty) | 1508 | if (have_pty) |