cURL / Mailing Lists / curl-library / Single Mail

curl-library

Patch for CURLOPT_MAXFILESIZE

From: codemastr <codemstr_at_ptd.net>
Date: Sat, 11 Oct 2003 16:08:37 -0400

I think I got this working, though I'm wondering if I missed something
seeing as how it seemed rather easy, and I would have thought someone would
have already done this... Anyway, since it is for file size limiting, I
figured that means it only makes sense for HTTP/FTP, so for HTTP it just
checks the result of the Content-Length and stops if it is too large, and
for FTP it checks the SIZE result. I also added for curl a --max-filesize
option to allow it to use this feature and it seems that it works perfectly
(note though that I haven't tested through an HTTP proxy since I don't have
access to any). Also, I didn't update the man pages or anything because I
wasn't sure exactly how the curl helpfiles work since there seems to be some
perl utilities to handle it so below is a brief description.

CURLOPT_MAXFILESIZE
This allows you to specify the maximum size (in bytes) of a file to
download. If the file requested is larger than this value, the transfer will
terminate and CURLE_FILESIZE_EXCEEDED will be returned.

The attached patch was made against the current CVS version of curl.

Dominick Meglio

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php

Received on 2003-10-11