From 912e9ca713bf4fd3c5bc3a6d115f1fcd8c31ed7d Mon Sep 17 00:00:00 2001 From: Sara Golemon Date: Sat, 18 Dec 2004 07:00:51 +0000 Subject: [PATCH] Fixed polling error in libssh2_channel_read_ex() --- README | 5 +++++ src/channel.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README b/README index 71766ce..7ac578b 100644 --- a/README +++ b/README @@ -1,6 +1,11 @@ libssh2 - SSH2 library ====================== +Version 0.3 +----------- + + Fixed libssh2_channel_read_ex(). Packet loop initialized BEFORE transport polled for new packets (should have been after). + Version 0.2 ----------- diff --git a/src/channel.c b/src/channel.c index c9bf4ee..3bebe18 100644 --- a/src/channel.c +++ b/src/channel.c @@ -546,10 +546,11 @@ LIBSSH2_API int libssh2_channel_read_ex(LIBSSH2_CHANNEL *channel, int stream_id, int bytes_read = 0, blocking_read = 0; do { - LIBSSH2_PACKET *packet = session->packets.head; + LIBSSH2_PACKET *packet; /* Process any waiting packets */ while (libssh2_packet_read(session, blocking_read) > 0) blocking_read = 0; + packet = session->packets.head; while (packet && (bytes_read < buflen)) { /* In case packet gets destroyed during this iteration */