Handle Client-To-Server channel windowing.

This commit is contained in:
Sara Golemon
2005-01-20 21:33:30 +00:00
parent bfc2f5039e
commit 5f7470700e
2 changed files with 15 additions and 2 deletions

View File

@@ -902,7 +902,7 @@ LIBSSH2_API int libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id
libssh2_error(session, LIBSSH2_ERROR_CHANNEL_EOF_SENT, "EOF has already been sight, data might be ignored", 0);
}
if (channel->blocking && channel->local.window_size_initial && (channel->local.window_size <= 0)) {
if (channel->blocking && (channel->local.window_size <= 0)) {
/* twiddle our thumbs until there's window space available */
if (libssh2_packet_read(session, 1) < 0) {
/* Error occured, disconnect? */
@@ -925,7 +925,7 @@ LIBSSH2_API int libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id
/* Don't exceed the remote end's limits */
/* REMEMBER local means local as the SOURCE of the data */
if (channel->local.window_size_initial && (buflen > channel->local.window_size)) {
if (buflen > channel->local.window_size) {
buflen = channel->local.window_size;
}
if (buflen > channel->local.packet_size) {