diff --git a/NEWS b/NEWS index d721fba1..341a22de 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ + +- (Deb 8 2009) + Markus Moeller fixed a flaw in libssh2_channel_write_ex() that would occur + on EAGAIN situations. + Version 1.0 ( ) ------------------------------- diff --git a/src/channel.c b/src/channel.c index 7350746b..0c7c5e2c 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1771,6 +1771,9 @@ libssh2_channel_write_ex(LIBSSH2_CHANNEL * channel, int stream_id, channel->write_state = libssh2_NB_state_allocated; } + /* deduct the amount thet has already been sent */ + buflen -= channel->write_bufwrote; + while (buflen > 0) { if (channel->write_state == libssh2_NB_state_allocated) { channel->write_bufwrite = buflen;