Subject: Re: libssh2_sftp_tell64() doesn't return the right pointer

Re: libssh2_sftp_tell64() doesn't return the right pointer

From: m odd <xieepp_at_gmail.com>
Date: Wed, 24 Aug 2011 20:44:25 +0800

@@ -1096,18 +1096,22 @@ static ssize_t sftp_read(LIBSSH2_SFTP_HANDLE *
handle, char *buffer,
         memcpy(buffer, &filep->data[ filep->data_len - filep->data_left],
                copy);

         total_read += copy;
         filep->data_left -= copy;
+ filep->offset += copy;

         if(filep->data_left)
             return total_read;

         LIBSSH2_FREE(session, filep->data);
         filep->data = NULL;
     }

+ if (total_read == buffer_size)
+ return total_read;
+
     /* We allow a number of bytes being requested at any given time without
        having been acked - until we reach EOF. */
     if(!filep->eof) {
         /* if the buffer_size passed in now is smaller than what has
already
            been sent, we risk getting count become a very large number */

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-08-24