1
1

Markus posted a bug report about a bad 0-return from libssh2_channel_read:

http://libssh2.haxx.se/mail/libssh2-devel-archive-2009-04/0076.shtml

  And it was indeed a bad loop that terminated too early due to a receveived
  close packet.
Этот коммит содержится в:
Daniel Stenberg 2009-04-30 10:30:26 +00:00
родитель 6409bb53ba
Коммит 9f104cd883
2 изменённых файлов: 16 добавлений и 1 удалений

8
NEWS
Просмотреть файл

@ -1,4 +1,12 @@
* (Apr 30 2009) Daniel Stenberg:
Markus posted a bug report about a bad 0-return from libssh2_channel_read:
http://libssh2.haxx.se/mail/libssh2-devel-archive-2009-04/0076.shtml
And it was indeed a bad loop that terminated too early due to a receveived
close packet.
* (Apr 14 2009) Daniel Stenberg:
libssh2_poll() and libssh2_poll_channel_read() are now considered and

Просмотреть файл

@ -1794,8 +1794,15 @@ static ssize_t channel_read(LIBSSH2_CHANNEL *channel, int stream_id,
channel->read_packet = session->packets.head;
while (channel->read_packet &&
!channel->remote.close &&
(bytes_read < (int) buflen)) {
/* previously this loop condition also checked for
!channel->remote.close but we cannot let it do this:
We may have a series of packets to read that are still pending even
if a close has been received. Acknowledging the close too early
makes us flush buffers prematurely and loose data.
*/
LIBSSH2_PACKET *readpkt = channel->read_packet;
/* In case packet gets destroyed during this iteration */