From d92fc07239af943d62e4e67791879707ec89e7d3 Mon Sep 17 00:00:00 2001 From: Zdenek Kotala Date: Mon, 26 Oct 2009 19:32:06 +0100 Subject: 6882255 sftp connection fails when .bashrc generates output on stderr 6886656 unlimited window size causes problems with limited buffer sizes 6894519 USE_PIPES is not used on Solaris and should be removed --- usr/src/cmd/ssh/libssh/common/channels.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'usr/src/cmd/ssh/libssh/common/channels.c') diff --git a/usr/src/cmd/ssh/libssh/common/channels.c b/usr/src/cmd/ssh/libssh/common/channels.c index c38a012dfe..3a0e6bad22 100644 --- a/usr/src/cmd/ssh/libssh/common/channels.c +++ b/usr/src/cmd/ssh/libssh/common/channels.c @@ -723,7 +723,8 @@ channel_pre_open(Channel *c, fd_set * readset, fd_set * writeset) if (c->istate == CHAN_INPUT_OPEN && limit > 0 && - buffer_len(&c->input) < limit) + buffer_len(&c->input) < limit && + buffer_check_alloc(&c->input, CHAN_RBUF)) FD_SET(c->rfd, readset); if (c->ostate == CHAN_OUTPUT_OPEN || c->ostate == CHAN_OUTPUT_WAIT_DRAIN) { @@ -1383,7 +1384,7 @@ channel_post_connecting(Channel *c, fd_set * readset, fd_set * writeset) static int channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset) { - char buf[16*1024]; + char buf[CHAN_RBUF]; int len; if (c->rfd != -1 && @@ -1477,7 +1478,7 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset) static int channel_handle_efd(Channel *c, fd_set * readset, fd_set * writeset) { - char buf[16*1024]; + char buf[CHAN_RBUF]; int len; /** XXX handle drain efd, too */ -- cgit v1.2.3