diff options
Diffstat (limited to 'clientloop.c')
-rw-r--r-- | clientloop.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/clientloop.c b/clientloop.c index 52667017c..141e0fff5 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,13 +496,13 @@ 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 (++keep_alive_timeouts > options.server_alive_count_max) { | 505 | if (packet_inc_alive_timeouts() > options.server_alive_count_max) { |
505 | logit("Timeout, server not responding."); | 506 | logit("Timeout, server not responding."); |
506 | cleanup_exit(255); | 507 | cleanup_exit(255); |
507 | } | 508 | } |
@@ -638,8 +639,8 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr) | |||
638 | static void | 639 | static void |
639 | client_process_net_input(fd_set *readset) | 640 | client_process_net_input(fd_set *readset) |
640 | { | 641 | { |
641 | int len; | 642 | int len, cont = 0; |
642 | char buf[8192]; | 643 | char buf[SSH_IOBUFSZ]; |
643 | 644 | ||
644 | /* | 645 | /* |
645 | * Read input from the server, and add any such data to the buffer of | 646 | * Read input from the server, and add any such data to the buffer of |
@@ -647,8 +648,8 @@ client_process_net_input(fd_set *readset) | |||
647 | */ | 648 | */ |
648 | if (FD_ISSET(connection_in, readset)) { | 649 | if (FD_ISSET(connection_in, readset)) { |
649 | /* Read as much as possible. */ | 650 | /* Read as much as possible. */ |
650 | len = read(connection_in, buf, sizeof(buf)); | 651 | len = roaming_read(connection_in, buf, sizeof(buf), &cont); |
651 | if (len == 0) { | 652 | if (len == 0 && cont == 0) { |
652 | /* | 653 | /* |
653 | * Received EOF. The remote host has closed the | 654 | * Received EOF. The remote host has closed the |
654 | * connection. | 655 | * connection. |
@@ -1132,7 +1133,7 @@ static void | |||
1132 | client_process_input(fd_set *readset) | 1133 | client_process_input(fd_set *readset) |
1133 | { | 1134 | { |
1134 | int len; | 1135 | int len; |
1135 | char buf[8192]; | 1136 | char buf[SSH_IOBUFSZ]; |
1136 | 1137 | ||
1137 | /* Read input from stdin. */ | 1138 | /* Read input from stdin. */ |
1138 | if (FD_ISSET(fileno(stdin), readset)) { | 1139 | if (FD_ISSET(fileno(stdin), readset)) { |
@@ -1434,11 +1435,13 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1434 | if (!rekeying) { | 1435 | if (!rekeying) { |
1435 | channel_after_select(readset, writeset); | 1436 | channel_after_select(readset, writeset); |
1436 | 1437 | ||
1438 | #ifdef GSSAPI | ||
1437 | if (options.gss_renewal_rekey && | 1439 | if (options.gss_renewal_rekey && |
1438 | ssh_gssapi_credentials_updated(GSS_C_NO_CONTEXT)) { | 1440 | ssh_gssapi_credentials_updated(GSS_C_NO_CONTEXT)) { |
1439 | debug("credentials updated - forcing rekey"); | 1441 | debug("credentials updated - forcing rekey"); |
1440 | need_rekeying = 1; | 1442 | need_rekeying = 1; |
1441 | } | 1443 | } |
1444 | #endif | ||
1442 | 1445 | ||
1443 | if (need_rekeying || packet_need_rekeying()) { | 1446 | if (need_rekeying || packet_need_rekeying()) { |
1444 | debug("need rekeying"); | 1447 | debug("need rekeying"); |
@@ -1487,6 +1490,14 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id) | |||
1487 | /* Stop watching for window change. */ | 1490 | /* Stop watching for window change. */ |
1488 | signal(SIGWINCH, SIG_DFL); | 1491 | signal(SIGWINCH, SIG_DFL); |
1489 | 1492 | ||
1493 | if (compat20) { | ||
1494 | packet_start(SSH2_MSG_DISCONNECT); | ||
1495 | packet_put_int(SSH2_DISCONNECT_BY_APPLICATION); | ||
1496 | packet_put_cstring("disconnected by user"); | ||
1497 | packet_send(); | ||
1498 | packet_write_wait(); | ||
1499 | } | ||
1500 | |||
1490 | channel_free_all(); | 1501 | channel_free_all(); |
1491 | 1502 | ||
1492 | if (have_pty) | 1503 | if (have_pty) |