sftp_packet_require: sftp_packet_read() returning 0 is not an error

Exactly as the comment in the code said, checking the return code from
sftp_packet_read() with <= was wrong and it should be < 0. With the new
filtering on incoming packets that are "zombies" we can now see this
getting zero returned.
This commit is contained in:
Daniel Stenberg
2012-05-10 23:09:37 +02:00
parent 1e15075a8e
commit 7c5ee0fa66

View File

@@ -513,10 +513,7 @@ sftp_packet_require(LIBSSH2_SFTP *sftp, unsigned char packet_type,
while (session->socket_state == LIBSSH2_SOCKET_CONNECTED) {
rc = sftp_packet_read(sftp);
if (rc == LIBSSH2_ERROR_EAGAIN)
return rc;
else if (rc <= 0)
/* TODO: isn't this supposed to be < 0 only? */
if (rc < 0)
return rc;
/* data was read, check the queue again */