cURL / Mailing Lists / curl-library / Single Mail


Re: Downloading unlimited file. Some clarification please.

From: Daniel Stenberg <>
Date: Tue, 3 Jan 2012 15:35:34 +0100 (CET)

On Tue, 3 Jan 2012, Fadi Kahhaleh wrote:

> I am using LibCURL to download files from a local server in my network. One
> gotcha about the file I am downloading is that it is endless!


> is there any option that i need to set?

No. That's a perfectly normal HTTP use case. To libcurl it doesn't matter if
it ever ends or not.

> after some period (which is random at best) my call back function starts to
> get small buffer sizes (i.e 300-ish bytes)compared to the a few hundered
> Kbytes i guess.

You guess wrong and this somehow tells us something. You see it get "small"
buffers but you have no idea how large they were before?

libcurl uses maximum 16K buffers unless you modified the build of it.

> I tried to download a fixed file size (but tried a large file approx. 350 Mb
> in size) and it caused the same behavior.

So then we can rule out that it is related to the never-ending stream, right?

> * Failed writing body (0 != 16384)
> * Closing connection #0

This indicates your write callback doesn't return the proper value.

List admin:
Received on 2012-01-03