summaryrefslogtreecommitdiffhomepage
path: root/common-channel.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2007-07-24 15:40:23 +0000
committerMatt Johnston <matt@ucc.asn.au>2007-07-24 15:40:23 +0000
commit2d4d9627a21f11a3e5caa17149e5391e71af256b (patch)
tree13055bd4d173cbf2c4c161d7e9d181cca47c5f7d /common-channel.c
parent762e9973ffb903c5431b8d4a310a94bc58dd80fd (diff)
Rearrange the channel buffer sizes into three neat use-editable values in
options.h. Increasing RECV_MAX_WINDOW gives big network performance increases - even with the present buffers (which haven't changed) it performs a lot better. Next step is to make the window size a cmdline option. --HG-- extra : convert_revision : 24c7cb47fb56cf5b82e3bc0859b45ea83038eab0
Diffstat (limited to 'common-channel.c')
-rw-r--r--common-channel.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/common-channel.c b/common-channel.c
index d77a575..ed6e5a2 100644
--- a/common-channel.c
+++ b/common-channel.c
@@ -150,11 +150,11 @@ struct Channel* newchannel(unsigned int remotechan,
newchan->await_open = 0;
newchan->flushing = 0;
- newchan->writebuf = cbuf_new(RECV_MAXWINDOW);
+ newchan->writebuf = cbuf_new(RECV_MAX_WINDOW);
newchan->extrabuf = NULL; /* The user code can set it up */
- newchan->recvwindow = RECV_MAXWINDOW;
+ newchan->recvwindow = RECV_MAX_WINDOW;
newchan->recvdonelen = 0;
- newchan->recvmaxpacket = RECV_MAXPACKET;
+ newchan->recvmaxpacket = RECV_MAX_PAYLOAD_LEN;
ses.channels[i] = newchan;
ses.chancount++;
@@ -421,7 +421,7 @@ static void writechannel(struct Channel* channel, int fd, circbuffer *cbuf) {
channel->recvdonelen = 0;
}
- dropbear_assert(channel->recvwindow <= RECV_MAXWINDOW);
+ dropbear_assert(channel->recvwindow <= RECV_MAX_WINDOW);
dropbear_assert(channel->recvwindow <= cbuf_getavail(channel->writebuf));
dropbear_assert(channel->extrabuf == NULL ||
channel->recvwindow <= cbuf_getavail(channel->extrabuf));
@@ -710,7 +710,7 @@ void common_recv_msg_channel_data(struct Channel *channel, int fd,
dropbear_assert(channel->recvwindow >= datalen);
channel->recvwindow -= datalen;
- dropbear_assert(channel->recvwindow <= RECV_MAXWINDOW);
+ dropbear_assert(channel->recvwindow <= RECV_MAX_WINDOW);
TRACE(("leave recv_msg_channel_data"))
}
@@ -727,10 +727,10 @@ void recv_msg_channel_window_adjust() {
incr = buf_getint(ses.payload);
TRACE(("received window increment %d", incr))
- incr = MIN(incr, MAX_TRANS_WIN_INCR);
+ incr = MIN(incr, TRANS_MAX_WIN_INCR);
channel->transwindow += incr;
- channel->transwindow = MIN(channel->transwindow, MAX_TRANS_WINDOW);
+ channel->transwindow = MIN(channel->transwindow, TRANS_MAX_WINDOW);
}
@@ -769,9 +769,9 @@ void recv_msg_channel_open() {
remotechan = buf_getint(ses.payload);
transwindow = buf_getint(ses.payload);
- transwindow = MIN(transwindow, MAX_TRANS_WINDOW);
+ transwindow = MIN(transwindow, TRANS_MAX_WINDOW);
transmaxpacket = buf_getint(ses.payload);
- transmaxpacket = MIN(transmaxpacket, MAX_TRANS_PAYLOAD_LEN);
+ transmaxpacket = MIN(transmaxpacket, TRANS_MAX_PAYLOAD_LEN);
/* figure what type of packet it is */
if (typelen > MAX_NAME_LEN) {
@@ -970,8 +970,8 @@ int send_msg_channel_open_init(int fd, const struct ChanType *type) {
buf_putbyte(ses.writepayload, SSH_MSG_CHANNEL_OPEN);
buf_putstring(ses.writepayload, type->name, strlen(type->name));
buf_putint(ses.writepayload, chan->index);
- buf_putint(ses.writepayload, RECV_MAXWINDOW);
- buf_putint(ses.writepayload, RECV_MAXPACKET);
+ buf_putint(ses.writepayload, RECV_MAX_WINDOW);
+ buf_putint(ses.writepayload, RECV_MAX_PAYLOAD_LEN);
TRACE(("leave send_msg_channel_open_init()"))
return DROPBEAR_SUCCESS;