diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-10-17 13:11:00 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-10-17 13:11:00 +0000 |
commit | ce5db9a86ea1508b0caaeec38adc5397e390dc3e (patch) | |
tree | e932aecf231b6fb77a0e98a1acfcb8caa1d80b16 /lib/transfer.c | |
parent | 94568f884dc30614f30918c9cca8cff40cc6c936 (diff) |
Dominick Meglio implemented CURLOPT_MAXFILESIZE and --max-filesize.
Diffstat (limited to 'lib/transfer.c')
-rw-r--r-- | lib/transfer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/transfer.c b/lib/transfer.c index 956a47996..1938a8a2c 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -578,6 +578,11 @@ CURLcode Curl_readwrite(struct connectdata *conn, /* check for Content-Length: header lines to get size */ if (checkprefix("Content-Length:", k->p) && sscanf (k->p+15, " %ld", &k->contentlength)) { + if (data->set.max_filesize && k->contentlength > + data->set.max_filesize) { + failf(data, "Maximum file size exceeded"); + return CURLE_FILESIZE_EXCEEDED; + } conn->size = k->contentlength; Curl_pgrsSetDownloadSize(data, k->contentlength); } |