cURL / Mailing Lists / curl-library / Single Mail

curl-library

stop downloading after x bytes?

From: Andrew <andrew_at_donehue.net>
Date: Fri, 06 Jan 2006 19:52:51 +1100

Hi All,

I am aware of the max-size option (where curl won't download if the file
is larger than x bytes), but i'm looking to download the first x bytes
of a file, regardless of how large it is.

I am thinking about putting about putting a size checker in the
WriteMemoryCallback function, however I want to use this in a
multi-threaded environment, and I want to be able to set the size to
stop downloading at as a paramater, not a global variable.

(How do I pass the option through the wirtememorycallback function? - I
can't see how to do this at the moment)?

Also, what is the best way to cancel a download?

Many Thanks,
Andrew.
Received on 2006-01-06