diff options
author | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:40:29 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2009-12-29 21:40:29 +0000 |
commit | a25ec0b132c44c9e341e08464ff830de06b81126 (patch) | |
tree | e20842d80f9e25cb6cf09525abea63f7bf655dd7 /channels.c | |
parent | 1b816ea846aca3ee89e7995373ace609e9518424 (diff) | |
parent | 70847d299887abb96f8703ca99db6d817b78960e (diff) |
import openssh-4.7p1-gsskex-20070927.patch
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/channels.c b/channels.c index c68ad6419..2006353d4 100644 --- a/channels.c +++ b/channels.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.268 2007/01/03 03:01:40 stevesk Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.270 2007/06/25 08:20:03 dtucker 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 |
@@ -1446,14 +1446,13 @@ static int | |||
1446 | channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) | 1446 | channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) |
1447 | { | 1447 | { |
1448 | char buf[CHAN_RBUF]; | 1448 | char buf[CHAN_RBUF]; |
1449 | int len; | 1449 | int len, force; |
1450 | 1450 | ||
1451 | if (c->rfd != -1 && | 1451 | force = c->isatty && c->detach_close && c->istate != CHAN_INPUT_CLOSED; |
1452 | (c->detach_close || FD_ISSET(c->rfd, readset))) { | 1452 | if (c->rfd != -1 && (force || FD_ISSET(c->rfd, readset))) { |
1453 | errno = 0; | 1453 | errno = 0; |
1454 | len = read(c->rfd, buf, sizeof(buf)); | 1454 | len = read(c->rfd, buf, sizeof(buf)); |
1455 | if (len < 0 && (errno == EINTR || | 1455 | if (len < 0 && (errno == EINTR || (errno == EAGAIN && !force))) |
1456 | (errno == EAGAIN && !(c->isatty && c->detach_close)))) | ||
1457 | return 1; | 1456 | return 1; |
1458 | #ifndef PTY_ZEROREAD | 1457 | #ifndef PTY_ZEROREAD |
1459 | if (len <= 0) { | 1458 | if (len <= 0) { |
@@ -1658,7 +1657,9 @@ channel_check_window(Channel *c) | |||
1658 | { | 1657 | { |
1659 | if (c->type == SSH_CHANNEL_OPEN && | 1658 | if (c->type == SSH_CHANNEL_OPEN && |
1660 | !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) && | 1659 | !(c->flags & (CHAN_CLOSE_SENT|CHAN_CLOSE_RCVD)) && |
1661 | c->local_window < c->local_window_max/2 && | 1660 | ((c->local_window_max - c->local_window > |
1661 | c->local_maxpacket*3) || | ||
1662 | c->local_window < c->local_window_max/2) && | ||
1662 | c->local_consumed > 0) { | 1663 | c->local_consumed > 0) { |
1663 | packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); | 1664 | packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); |
1664 | packet_put_int(c->remote_id); | 1665 | packet_put_int(c->remote_id); |