Subject: Re: libssh2_sftp_seek64 doesn't work

Re: libssh2_sftp_seek64 doesn't work

From: Ezequiel Ruiz <eruiz_at_barcelona04.com>
Date: Wed, 24 Aug 2011 11:19:53 -0300

2011/8/24 m odd <xieepp_at_gmail.com>

> /* 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 */
> if((buffer_size*4) > already)
> count = (buffer_size*4) - already;
> }
>
> In the sftp_read(), the actually request count is bigger than
> buffer_size,so, the previous call will get more data than you want.
> I think libssh2_sftp_seek64() must discard the unnecessary request packet
> and the data already stored.
>
> LIBSSH2_API void
> libssh2_sftp_seek64(LIBSSH2_SFTP_HANDLE *handle, libssh2_uint64_t offset)
> {
> if(handle) {
> handle->u.file.offset = handle->u.file.offset_sent = offset;
> sftp_packetlist_flush(handle);
> if (handle->u.file.data_left) {
>
> LIBSSH2_FREE(handle->sftp->channel->session, handle->u.file.data);
> handle->u.file.data_left = handle->u.file.data_len = 0;
> handle->u.file.data = NULL;
> }
> }
> }
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>
Sorry... is that a patch? can you show me the changes you made please? (with
a diff should be enough)

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