cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: New feature suggestion: hard file size limit

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 24 Sep 2001 10:42:19 +0200 (MET DST)

On Sun, 23 Sep 2001, Lucas Adamski wrote:

> For servers that don't support the RANGE feature of 1.1 and FTP too I
> guess, would it be possible to implement a feature that would provide a
> hard limit for the download in bytes, terminating the transfer in the
> most graceful manner possible if that limit is exceeded? Thanks,

FTP transfers already support download-"ranges" thanks to an implemented
"hard limit" such as the one you describe.

There's no "external" way to set that limit however. It is possible to have a
write callback stop the writing by returning an error code, but I figure you
don't want an error code returned back. Would a CURLOPT_MAXDOWNLOAD option
that sets the maximum number of bytes to download suffice?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-09-24