From c547e07caa66e4a42608c9c4da1cadb529a5e7ad Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 8 Feb 2009 12:09:20 +0000 Subject: [PATCH] Markus Moeller fixed a flaw in libssh2_channel_write_ex() that would occur on EAGAIN situations. --- NEWS | 5 +++++ src/channel.c | 3 +++ 2 files changed, 8 insertions(+) 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;