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.
Этот коммит содержится в:
родитель
6409bb53ba
Коммит
9f104cd883
8
NEWS
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 */
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user