Subject: Re: libssh2_sftp_seek64 doesn't work

Re: libssh2_sftp_seek64 doesn't work

From: m odd <xieepp_at_gmail.com>
Date: Thu, 25 Aug 2011 16:33:28 +0800

libssh2_sftp_seek64 should do more work than now, But my code is not very
correct. am i right?

2011/8/25 Ezequiel Ruiz <eruiz_at_barcelona04.com>

>
> 2011/8/24 m odd <xieepp_at_gmail.com>
>
>> 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;
>> + if(handle) {
>> + handle->u.file.offset = handle->u.file.offset_sent = offset;
>> + /* discard the request */
>> + sftp_packetlist_flush(handle);
>> +
>> + /* free the left received data */
>> + 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;
>> + }
>> + }
>> }
>>
>> Just my point about the problem.
>>
>> _______________________________________________
>> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>>
>>
> hey!!, this solves the problem! At least my seek64() calls are working back
> again!. You should post this patch so it can be included in the git repo.
> Nice work!, and thanks!!
>
> Ezequiel
>
> _______________________________________________
> libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
>
>

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