aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2012-05-02 17:35:47 +0200
committermilo <milo@r0ot.me>2012-05-05 18:04:13 +0200
commit386b0d087dd3e1056de0a86e242a97b51e2080e3 (patch)
tree17e9ef5b8cea7a1fe2ededd7e2d4543637e27825
parent348a2c1090bbdbadf87192fe27f494a675d68085 (diff)
downloadlibssh-386b0d087dd3e1056de0a86e242a97b51e2080e3.tar.gz
libssh-386b0d087dd3e1056de0a86e242a97b51e2080e3.tar.xz
libssh-386b0d087dd3e1056de0a86e242a97b51e2080e3.zip
Add a public ssh_grow_window function for flow control
-rw-r--r--include/libssh/libssh.h1
-rw-r--r--src/channels.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/include/libssh/libssh.h b/include/libssh/libssh.h
index f22ce71..102dfb2 100644
--- a/include/libssh/libssh.h
+++ b/include/libssh/libssh.h
@@ -384,6 +384,7 @@ LIBSSH_API int ssh_channel_select(ssh_channel *readchans, ssh_channel *writechan
LIBSSH_API void ssh_channel_set_blocking(ssh_channel channel, int blocking);
LIBSSH_API int ssh_channel_write(ssh_channel channel, const void *data, uint32_t len);
LIBSSH_API uint32_t ssh_channel_window_size(ssh_channel channel);
+LIBSSH_API int ssh_channel_grow_window(ssh_channel channel, uint32_t add_bytes);
LIBSSH_API char *ssh_basename (const char *path);
LIBSSH_API void ssh_clean_pubkey_hash(unsigned char **hash);
diff --git a/src/channels.c b/src/channels.c
index 3f65010..bc4d9bb 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -402,6 +402,13 @@ error:
return SSH_ERROR;
}
+int ssh_channel_grow_window(ssh_channel channel, uint32_t add_bytes) {
+ if(channel == NULL || channel->session == NULL) {
+ return SSH_ERROR;
+ }
+ return grow_window(channel->session, channel, channel->local_window + add_bytes);
+}
+
/**
* @internal
*