diff --git a/src/channel.c b/src/channel.c index 5181f6f..63e5d5b 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1418,7 +1418,7 @@ _libssh2_channel_flush(LIBSSH2_CHANNEL *channel, int streamid) rc = _libssh2_channel_receive_window_adjust(channel, channel->flush_refund_bytes, - 0, NULL); + 1, NULL); if (rc == LIBSSH2_ERROR_EAGAIN) return rc; } diff --git a/src/packet.c b/src/packet.c index 5852d0c..364b434 100644 --- a/src/packet.c +++ b/src/packet.c @@ -661,7 +661,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data, rc = _libssh2_channel_receive_window_adjust(session-> packAdd_channelp, datalen - 13, - 0, NULL); + 1, NULL); if (rc == LIBSSH2_ERROR_EAGAIN) return rc; diff --git a/src/sftp.c b/src/sftp.c index 6d73751..96e00aa 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -285,7 +285,7 @@ sftp_packet_read(LIBSSH2_SFTP *sftp) /* ask for twice the data amount we need at once */ rc = _libssh2_channel_receive_window_adjust(channel, sftp->partial_len*2, - 0, NULL); + 1, NULL); /* store the state so that we continue with the correct operation at next invoke */ sftp->packet_state = (rc == LIBSSH2_ERROR_EAGAIN)? @@ -1262,7 +1262,7 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE * handle, char *buffer, rc = _libssh2_channel_receive_window_adjust(sftp->channel, max_read_ahead*8, - 0, NULL); + 1, NULL); /* if this returns EAGAIN, we will get back to this function at next call */ assert(rc != LIBSSH2_ERROR_EAGAIN || !filep->data_left);