cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: truncated files (was Re: curl-library Digest, Vol 92, Issue 16)

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 8 Apr 2013 11:17:30 +0200 (CEST)

On Mon, 8 Apr 2013, Giuseppe Attardi wrote:

Please switch off the mailing list digest delivery option if you intend to
participate in discussions on the list. It'll make life easier for us all!

>> You could still have a zlib enabled libcurl if you just add the correct
>> Accept-Encoding header manually instead.

> Does this affect the way libcurl determines transfer completion (you
> implicitely answered no)?

No.

> Is compressed transfer always performed using chunked encoding?

No.

> Shall I disable HTTP_TRANSFER_DECODING?

It doesn't matter, because it probably is content-encoded and not
transfer-encoded...

> I don't think it is a libcurl problem. I suspect it is the way it is used in
> combination with libevent, multithreading and gzip.

Any way you can simplify your code and try out a version for example without
multi-threading ?

> For example, to me it sounds unlikely that a call to
> curl_multi_socket_action does not trigger the WRITEFUNCTION callback and
> that when asked for curl_multi_info_read it returns CURLMSG_DONE, without
> raising an error.

Yes, _unlikely_ is a word I would use as well but it can still happen if the
data is sent old-style HTTP/1.0, without Content-Length and with only a closed
connection as a way to signal end of transfer.

> If the server had interrupted the transfer, libcurl would have noticed,
> right?

Unless it was the situation as mentioned above, yes.

> How does gzip compression interfere with detecting transfer completion?

Not at all. It just transfers content that is gzipped. There's no added nor
removed magic for detecting completion in that situation. You should get the
same problems without asking for compressed content as well, as long as the
server acts the same way then.

> I am also using KeepAlive, does this matter?

What does "using KeepAlive" mean exactly? (But I don't think it matters, no.)

> So if you see nothing wrong in my use of events and callbacks, I will
> continue investigating other parts of the program.

I couldn't judge the level of correctness just based on that little snippet,
sorry.

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