diff options
-rw-r--r-- | usr.bin/ssh/channels.c | 7 | ||||
-rw-r--r-- | usr.bin/ssh/channels.h | 16 | ||||
-rw-r--r-- | usr.bin/ssh/session.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/ssh.c | 8 |
4 files changed, 18 insertions, 18 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index babb9c47b40..2daa37aeb8d 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: channels.c,v 1.167 2002/02/06 14:55:15 markus Exp $"); +RCSID("$OpenBSD: channels.c,v 1.168 2002/02/14 23:27:59 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -644,15 +644,14 @@ channel_register_filter(int id, channel_filter_fn *fn) void channel_set_fds(int id, int rfd, int wfd, int efd, - int extusage, int nonblock) + int extusage, int nonblock, u_int window_max) { Channel *c = channel_lookup(id); if (c == NULL || c->type != SSH_CHANNEL_LARVAL) fatal("channel_activate for non-larval channel %d.", id); channel_register_fds(c, rfd, wfd, efd, extusage, nonblock); c->type = SSH_CHANNEL_OPEN; - /* XXX window size? */ - c->local_window = c->local_window_max = c->local_maxpacket * 2; + c->local_window = c->local_window_max = window_max; packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST); packet_put_int(c->remote_id); packet_put_int(c->local_window); diff --git a/usr.bin/ssh/channels.h b/usr.bin/ssh/channels.h index 7cb0c367cbb..b637ab32c5f 100644 --- a/usr.bin/ssh/channels.h +++ b/usr.bin/ssh/channels.h @@ -32,7 +32,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* RCSID("$OpenBSD: channels.h,v 1.63 2002/02/05 14:32:55 markus Exp $"); */ +/* RCSID("$OpenBSD: channels.h,v 1.64 2002/02/14 23:28:00 markus Exp $"); */ #ifndef CHANNEL_H #define CHANNEL_H @@ -113,12 +113,12 @@ struct Channel { #define CHAN_EXTENDED_WRITE 2 /* default window/packet sizes for tcp/x11-fwd-channel */ -#define CHAN_SES_WINDOW_DEFAULT (32*1024) -#define CHAN_SES_PACKET_DEFAULT (CHAN_SES_WINDOW_DEFAULT/2) -#define CHAN_TCP_WINDOW_DEFAULT (32*1024) -#define CHAN_TCP_PACKET_DEFAULT (CHAN_TCP_WINDOW_DEFAULT/2) -#define CHAN_X11_WINDOW_DEFAULT (4*1024) -#define CHAN_X11_PACKET_DEFAULT (CHAN_X11_WINDOW_DEFAULT/2) +#define CHAN_SES_PACKET_DEFAULT (32*1024) +#define CHAN_SES_WINDOW_DEFAULT (4*CHAN_SES_PACKET_DEFAULT) +#define CHAN_TCP_PACKET_DEFAULT (32*1024) +#define CHAN_TCP_WINDOW_DEFAULT (4*CHAN_TCP_PACKET_DEFAULT) +#define CHAN_X11_PACKET_DEFAULT (16*1024) +#define CHAN_X11_WINDOW_DEFAULT (4*CHAN_X11_PACKET_DEFAULT) /* possible input states */ #define CHAN_INPUT_OPEN 0 @@ -139,7 +139,7 @@ struct Channel { Channel *channel_lookup(int); Channel *channel_new(char *, int, int, int, int, int, int, int, char *, int); -void channel_set_fds(int, int, int, int, int, int); +void channel_set_fds(int, int, int, int, int, int, u_int); void channel_free(Channel *); void channel_free_all(void); void channel_stop_listening(void); diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index d98cfa9eea2..8e161702244 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.125 2002/02/09 17:37:34 deraadt Exp $"); +RCSID("$OpenBSD: session.c,v 1.126 2002/02/14 23:28:00 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -1427,7 +1427,8 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr) channel_set_fds(s->chanid, fdout, fdin, fderr, fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ, - 1); + 1, + CHAN_SES_WINDOW_DEFAULT); } /* diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index 251b3635985..44af61f4d4e 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -39,7 +39,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh.c,v 1.163 2002/02/07 09:35:39 markus Exp $"); +RCSID("$OpenBSD: ssh.c,v 1.164 2002/02/14 23:28:00 markus Exp $"); #include <openssl/evp.h> #include <openssl/err.h> @@ -1125,9 +1125,9 @@ ssh_session2_open(void) window = CHAN_SES_WINDOW_DEFAULT; packetmax = CHAN_SES_PACKET_DEFAULT; - if (!tty_flag) { - window *= 2; - packetmax *=2; + if (tty_flag) { + window >>= 1; + packetmax >>= 1; } c = channel_new( "session", SSH_CHANNEL_OPENING, in, out, err, |