From ea9700ba72956ee2ef0180e62c6d5fe58271dc9a Mon Sep 17 00:00:00 2001 From: djm Date: Tue, 19 Feb 2002 04:20:57 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2002/02/14 23:28:00 [channels.h session.c ssh.c] increase the SSH v2 window size to 4 packets. comsumes a little bit more memory for slow receivers but increases througput. --- ChangeLog | 4 ++++ channels.h | 16 ++++++++-------- session.c | 5 +++-- ssh.c | 8 ++++---- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f08e0e9..327aed92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,10 @@ [channels.c] increase the SSH v2 window size to 4 packets. comsumes a little bit more memory for slow receivers but increases througput. + - markus@cvs.openbsd.org 2002/02/14 23:28:00 + [channels.h session.c ssh.c] + increase the SSH v2 window size to 4 packets. comsumes a little + bit more memory for slow receivers but increases througput. 20020218 - (tim) newer config.guess from ftp://ftp.gnu.org/gnu/config/config.guess diff --git a/channels.h b/channels.h index 7cb0c367..b637ab32 100644 --- a/channels.h +++ b/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/session.c b/session.c index 441ff8cd..f9f5da80 100644 --- a/session.c +++ b/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" @@ -1781,7 +1781,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/ssh.c b/ssh.c index 236f2b52..117a0930 100644 --- a/ssh.c +++ b/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 #include @@ -1145,9 +1145,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, -- 2.45.2