cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Conditions for CURLE_PARTIAL_FILE (18)

From: Michael-O <1983-01-06_at_gmx.net>
Date: Sun, 17 Nov 2013 17:01:02 +0100

Am 2013-11-16 23:09, schrieb Daniel Stenberg:
> On Sat, 16 Nov 2013, Michael-O wrote:
>
>>> Yes, if there's data left in a chunk when the transfer ends. A broken
>>> last chunk.
>>
>> Thanks a lot. I would have expected the docs to be clearer in the case
>> of chunked transfer or at least mention chunked transfer in contrast
>> to fixed-size Content-Length.
>
> Really? I just checked curl.1 and libcurl-errors.3 and they mention
> "Partial file. Only a part of the file was transferred" and "A file
> transfer was shorter or larger than expected." etc. None of them
> mentions nor implies that Content-Length checking is the (only) way.
> Also, the return code actually works for non-HTTP protocols as well...

 From my use case view, yes! The server was responding plain text and it
seemed to be complete when I looked at stdout. Nothing was missing. It
took me sometime to understand that chunked encoding was involved and
the final "0\r\n" chunk was missing (--ascii). Apparently, data was
complete but not from curl's point of view.

> But please, feel free to suggest a modified wording you think would
> explain this better!
>

My problem is simply this sentence: "This happens when the server first
reports an expected transfer size, and then delivers data that doesn't
match the previously given size."

This implies (to me) that the server actually tells how big the entire
transfer is going to be which is not the case with chunks. Simply, the
last one was missing. Maybe this would clarify: "This happens when the
server first reports an expected overall or chunk transfer size, and
then delivers data that doesn't match the previously given size or omits
the data (chunks) at all." It would at least give me a hint to inspect
the transfered chunks.

Michael

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-17