]> andersk Git - gssapi-openssh.git/blobdiff - openssh/channels.c
Release new patch.
[gssapi-openssh.git] / openssh / channels.c
index 030a2deb9b6fb4656dc845e3a87851cbdbae8be0..410f75e03e6d3d6cfec58135e47fee69a9d74c78 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: channels.c,v 1.268 2007/01/03 03:01:40 stevesk Exp $ */
+/* $OpenBSD: channels.c,v 1.270 2007/06/25 08:20:03 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -76,7 +76,6 @@
 #include "authfd.h"
 #include "pathnames.h"
 
-
 /* -- channel core */
 
 /*
@@ -1471,14 +1470,13 @@ static int
 channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset)
 {
        char buf[CHAN_RBUF];
-       int len;
+       int len, force;
 
-       if (c->rfd != -1 &&
-           (c->detach_close || FD_ISSET(c->rfd, readset))) {
+       force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED;
+       if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) {
                errno = 0;
                len = read(c->rfd, buf, sizeof(buf));
-               if (len < 0 && (errno == EINTR ||
-                   (errno == EAGAIN && !(c->isatty && c->detach_close))))
+               if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force)))
                        return 1;
 #ifndef PTY_ZEROREAD
                if (len <= 0) {
@@ -1683,7 +1681,9 @@ channel_check_window(Channel *c)
 {
        if (c->type == SSH_CHANNEL_OPEN &&
            !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) &&
-           c->local_window < c->local_window_max/2 &&
+           ((c->local_window_max - c->local_window >
+           c->local_maxpacket*3) ||
+           c->local_window < c->local_window_max/2) &&
            c->local_consumed > 0) {
                u_int addition = 0;
                /* adjust max window size if we are in a dynamic environment */
This page took 0.102429 seconds and 4 git commands to generate.