]> andersk Git - openssh.git/blobdiff - clientloop.c
- (tim) [contrib/cygwin/Makefile] Install ssh-copy-id and ssh-copy-id.1
[openssh.git] / clientloop.c
index d5a06556aaa910bc01b40553bd625a116caaf1ca..9a7dc0ab0b01ba9b58848bb6dce0cbbbfcfb085e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.211 2009/05/27 06:33:39 andreas Exp $ */
+/* $OpenBSD: clientloop.c,v 1.213 2009/07/05 19:28:33 stevesk Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
 #include "misc.h"
 #include "match.h"
 #include "msg.h"
+#include "roaming.h"
 
 /* import options */
 extern Options options;
@@ -634,8 +635,8 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
 static void
 client_process_net_input(fd_set *readset)
 {
-       int len;
-       char buf[8192];
+       int len, cont = 0;
+       char buf[SSH_IOBUFSZ];
 
        /*
         * Read input from the server, and add any such data to the buffer of
@@ -643,8 +644,8 @@ client_process_net_input(fd_set *readset)
         */
        if (FD_ISSET(connection_in, readset)) {
                /* Read as much as possible. */
-               len = read(connection_in, buf, sizeof(buf));
-               if (len == 0) {
+               len = roaming_read(connection_in, buf, sizeof(buf), &cont);
+               if (len == 0 && cont == 0) {
                        /*
                         * Received EOF.  The remote host has closed the
                         * connection.
@@ -1128,7 +1129,7 @@ static void
 client_process_input(fd_set *readset)
 {
        int len;
-       char buf[8192];
+       char buf[SSH_IOBUFSZ];
 
        /* Read input from stdin. */
        if (FD_ISSET(fileno(stdin), readset)) {
@@ -1476,11 +1477,13 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
        /* Stop watching for window change. */
        signal(SIGWINCH, SIG_DFL);
 
-       packet_start(SSH2_MSG_DISCONNECT);
-       packet_put_int(SSH2_DISCONNECT_BY_APPLICATION);
-       packet_put_cstring("disconnected by user");
-       packet_send();
-       packet_write_wait();
+       if (compat20) {
+               packet_start(SSH2_MSG_DISCONNECT);
+               packet_put_int(SSH2_DISCONNECT_BY_APPLICATION);
+               packet_put_cstring("disconnected by user");
+               packet_send();
+               packet_write_wait();
+       }
 
        channel_free_all();
 
This page took 0.041023 seconds and 4 git commands to generate.