diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | channels.c | 22 |
2 files changed, 23 insertions, 6 deletions
@@ -15,6 +15,11 @@ | |||
15 | - markus@cvs.openbsd.org 2004/01/13 19:45:15 | 15 | - markus@cvs.openbsd.org 2004/01/13 19:45:15 |
16 | [compress.c] | 16 | [compress.c] |
17 | cast for portability; millert@ | 17 | cast for portability; millert@ |
18 | - markus@cvs.openbsd.org 2004/01/19 09:24:21 | ||
19 | [channels.c] | ||
20 | fake consumption for half closed channels since the peer is waiting for | ||
21 | window adjust messages; bugzilla #790 Matthew Dillon; test + ok dtucker@ | ||
22 | reproduce with sh -c 'ulimit -f 10; ssh host -n od /bsd | cat > foo' | ||
18 | 23 | ||
19 | 20040114 | 24 | 20040114 |
20 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits | 25 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits |
@@ -1684,4 +1689,4 @@ | |||
1684 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 1689 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
1685 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 1690 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
1686 | 1691 | ||
1687 | $Id: ChangeLog,v 1.3173 2004/01/21 00:01:23 djm Exp $ | 1692 | $Id: ChangeLog,v 1.3174 2004/01/21 00:02:09 djm Exp $ |
diff --git a/channels.c b/channels.c index 14405bd4b..e663c2159 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.199 2003/12/02 17:01:14 markus Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.200 2004/01/19 09:24:21 markus Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -1817,13 +1817,25 @@ channel_input_data(int type, u_int32_t seq, void *ctxt) | |||
1817 | c->type != SSH_CHANNEL_X11_OPEN) | 1817 | c->type != SSH_CHANNEL_X11_OPEN) |
1818 | return; | 1818 | return; |
1819 | 1819 | ||
1820 | /* same for protocol 1.5 if output end is no longer open */ | ||
1821 | if (!compat13 && c->ostate != CHAN_OUTPUT_OPEN) | ||
1822 | return; | ||
1823 | |||
1824 | /* Get the data. */ | 1820 | /* Get the data. */ |
1825 | data = packet_get_string(&data_len); | 1821 | data = packet_get_string(&data_len); |
1826 | 1822 | ||
1823 | /* | ||
1824 | * Ignore data for protocol > 1.3 if output end is no longer open. | ||
1825 | * For protocol 2 the sending side is reducing its window as it sends | ||
1826 | * data, so we must 'fake' consumption of the data in order to ensure | ||
1827 | * that window updates are sent back. Otherwise the connection might | ||
1828 | * deadlock. | ||
1829 | */ | ||
1830 | if (!compat13 && c->ostate != CHAN_OUTPUT_OPEN) { | ||
1831 | if (compat20) { | ||
1832 | c->local_window -= data_len; | ||
1833 | c->local_consumed += data_len; | ||
1834 | } | ||
1835 | xfree(data); | ||
1836 | return; | ||
1837 | } | ||
1838 | |||
1827 | if (compat20) { | 1839 | if (compat20) { |
1828 | if (data_len > c->local_maxpacket) { | 1840 | if (data_len > c->local_maxpacket) { |
1829 | logit("channel %d: rcvd big packet %d, maxpack %d", | 1841 | logit("channel %d: rcvd big packet %d, maxpack %d", |