cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Issue with partial file transfer

From: Grzegorz Sikorski <engineer.gregor_at_gmail.com>
Date: Fri, 20 Apr 2012 11:24:42 +0200

On Thu, Apr 19, 2012 at 10:13 PM, Daniel Stenberg <daniel_at_haxx.se> wrote:

> On Thu, 19 Apr 2012, Grzegorz Sikorski wrote:
>
> I have made some patch in lib/ftp.c file in function ftp_state_ul_setup.
>> Here is a diff:
>>
>
> Isn't the diff reversed?

Possibly, sorry about that.

>
>
> Let me know if you think that is OK. I tested it and it works also in 4
>> case described in previous message.
>>
>
> It is not OK since it changes behavior for existing application in a very
> drastic way.
>

I do not agree. If libcurl always assume the file is sought back to the
start, it is no change anyway. The only thing it might brake is situation,
when user tries to put on the server part of the file and seeks the pointer
to the middle before transfer. This is rather strange request and I am not
sure if it really could success anyway.

>
> In general libcurl doesn't seek for anything where there's no need for it
> to seek, it only seeks when it has done something within the request that
> has moved the file position forward and it needs to put it back.
>

In my opinion libcurl really need to seek back. Its transfer caused the
file seek and only libcurl may know if the file really needs to be sought
back. Application does not know what is the status of the file on the
server side, and libcurl knows that from SIZE response. But this is only my
opinion.

> In your case, libcurl has not moved the file position to start with.
>
> I would much rather have us make this clearer in the documentation somehow!

Definitely agree, it should be done anyway.

>
>
> --
>
> / daniel.haxx.se
> ------------------------------**------------------------------**-------
> List admin: http://cool.haxx.se/list/**listinfo/curl-library<http://cool.haxx.se/list/listinfo/curl-library>
> Etiquette: http://curl.haxx.se/mail/**etiquette.html<http://curl.haxx.se/mail/etiquette.html>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-20