View | Details | Raw Unified | Return to bug 105
Collapse All | Expand All

(-)channels.c (-3 / +2 lines)
Lines 651-665 Link Here
651
651
652
void
652
void
653
channel_set_fds(int id, int rfd, int wfd, int efd,
653
channel_set_fds(int id, int rfd, int wfd, int efd,
654
    int extusage, int nonblock)
654
    int extusage, int nonblock, u_int window_max)
655
{
655
{
656
	Channel *c = channel_lookup(id);
656
	Channel *c = channel_lookup(id);
657
	if (c == NULL || c->type != SSH_CHANNEL_LARVAL)
657
	if (c == NULL || c->type != SSH_CHANNEL_LARVAL)
658
		fatal("channel_activate for non-larval channel %d.", id);
658
		fatal("channel_activate for non-larval channel %d.", id);
659
	channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);
659
	channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);
660
	c->type = SSH_CHANNEL_OPEN;
660
	c->type = SSH_CHANNEL_OPEN;
661
	/* XXX window size? */
661
	c->local_window = c->local_window_max = window_max;
662
	c->local_window = c->local_window_max = c->local_maxpacket * 2;
663
	packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);
662
	packet_start(SSH2_MSG_CHANNEL_WINDOW_ADJUST);
664
	packet_put_int(c->remote_id);
663
	packet_put_int(c->remote_id);
665
	packet_put_int(c->local_window);
664
	packet_put_int(c->local_window);
(-)channels.h (-7 / +7 lines)
Lines 114-125 Link Here
114
#define CHAN_EXTENDED_WRITE		2
114
#define CHAN_EXTENDED_WRITE		2
115
115
116
/* default window/packet sizes for tcp/x11-fwd-channel */
116
/* default window/packet sizes for tcp/x11-fwd-channel */
117
#define CHAN_SES_WINDOW_DEFAULT	(32*1024)
117
#define CHAN_SES_PACKET_DEFAULT	(32*1024)
118
#define CHAN_SES_PACKET_DEFAULT	(CHAN_SES_WINDOW_DEFAULT/2)
118
#define CHAN_SES_WINDOW_DEFAULT	(4*CHAN_SES_PACKET_DEFAULT)
119
#define CHAN_TCP_WINDOW_DEFAULT	(32*1024)
119
#define CHAN_TCP_PACKET_DEFAULT	(32*1024)
120
#define CHAN_TCP_PACKET_DEFAULT	(CHAN_TCP_WINDOW_DEFAULT/2)
120
#define CHAN_TCP_WINDOW_DEFAULT	(4*CHAN_TCP_PACKET_DEFAULT)
121
#define CHAN_X11_WINDOW_DEFAULT	(4*1024)
121
#define CHAN_X11_PACKET_DEFAULT	(16*1024)
122
#define CHAN_X11_PACKET_DEFAULT	(CHAN_X11_WINDOW_DEFAULT/2)
122
#define CHAN_X11_WINDOW_DEFAULT	(4*CHAN_X11_PACKET_DEFAULT)
123
123
124
/* possible input states */
124
/* possible input states */
125
#define CHAN_INPUT_OPEN			0x01
125
#define CHAN_INPUT_OPEN			0x01
Lines 140-146 Link Here
140
140
141
Channel	*channel_lookup(int);
141
Channel	*channel_lookup(int);
142
Channel *channel_new(char *, int, int, int, int, int, int, int, char *, int);
142
Channel *channel_new(char *, int, int, int, int, int, int, int, char *, int);
143
void	 channel_set_fds(int, int, int, int, int, int);
143
void	 channel_set_fds(int, int, int, int, int, int, u_int);
144
void	 channel_free(Channel *);
144
void	 channel_free(Channel *);
145
void	 channel_free_all(void);
145
void	 channel_free_all(void);
146
void	 channel_stop_listening(void);
146
void	 channel_stop_listening(void);
(-)session.c (-1 / +2 lines)
Lines 1843-1849 Link Here
1843
	channel_set_fds(s->chanid,
1843
	channel_set_fds(s->chanid,
1844
	    fdout, fdin, fderr,
1844
	    fdout, fdin, fderr,
1845
	    fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
1845
	    fderr == -1 ? CHAN_EXTENDED_IGNORE : CHAN_EXTENDED_READ,
1846
	    1);
1846
	    1,
1847
	    CHAN_SES_WINDOW_DEFAULT);
1847
}
1848
}
1848
1849
1849
/*
1850
/*
(-)ssh.c (-3 / +3 lines)
Lines 1130-1138 Link Here
1130
1130
1131
	window = CHAN_SES_WINDOW_DEFAULT;
1131
	window = CHAN_SES_WINDOW_DEFAULT;
1132
	packetmax = CHAN_SES_PACKET_DEFAULT;
1132
	packetmax = CHAN_SES_PACKET_DEFAULT;
1133
	if (!tty_flag) {
1133
	if (tty_flag) {
1134
		window *= 2;
1134
		window >>= 1;
1135
		packetmax *=2;
1135
		packetmax >>= 1;
1136
	}
1136
	}
1137
	c = channel_new(
1137
	c = channel_new(
1138
	    "session", SSH_CHANNEL_OPENING, in, out, err,
1138
	    "session", SSH_CHANNEL_OPENING, in, out, err,

Return to bug 105