summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-05-02 20:47:19 +0000
committerAndreas Schneider <mail@cynapses.org>2009-05-02 20:47:19 +0000
commit653812149469289b177d39fcbe335fb75d427c31 (patch)
tree151452be6ce4321c8c255c45e52bbd87274ac0f9
parent0534fee674e0faec49d875ae3d2e71c966da399b (diff)
downloadlibssh-653812149469289b177d39fcbe335fb75d427c31.tar.gz
libssh-653812149469289b177d39fcbe335fb75d427c31.tar.xz
libssh-653812149469289b177d39fcbe335fb75d427c31.zip
Improve grow_window().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@675 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r--libssh/channels.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libssh/channels.c b/libssh/channels.c
index 4506d53..6470173 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -255,13 +255,9 @@ static int grow_window(SSH_SESSION *session, CHANNEL *channel, int minimumsize)
enter_function();
- if (buffer_add_u8(session->out_buffer,SSH2_MSG_CHANNEL_WINDOW_ADJUST) < 0) {
- goto error;
- }
- if (buffer_add_u32(session->out_buffer,htonl(channel->remote_channel)) < 0) {
- goto error;
- }
- if (buffer_add_u32(session->out_buffer,htonl(new_window)) < 0) {
+ if (buffer_add_u8(session->out_buffer, SSH2_MSG_CHANNEL_WINDOW_ADJUST) < 0 ||
+ buffer_add_u32(session->out_buffer, htonl(channel->remote_channel)) < 0 ||
+ buffer_add_u32(session->out_buffer, htonl(new_window)) < 0) {
goto error;
}
@@ -270,14 +266,16 @@ static int grow_window(SSH_SESSION *session, CHANNEL *channel, int minimumsize)
leave_function();
return 1;
}
+
ssh_log(session, SSH_LOG_PROTOCOL,
"growing window (channel %d:%d) to %d bytes",
channel->local_channel,
channel->remote_channel,
channel->local_window + new_window);
- channel->local_window+=new_window;
- leave_function();
+ channel->local_window += new_window;
+
+ leave_function();
return 0;
error:
buffer_free(session->out_buffer);