← Commit list

89f38c168c

Daniel Stenberg
Daniel Stenberg
2026-05-13
SUCCESS Duration: 259s

Subject

CURLOPT_MAXFILESIZE: clarify this also works for on-going transfers

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

docs/libcurl/opts/CURLOPT_MAXFILESIZE.md+11 -8
@@ -32,17 +32,16 @@ value, the transfer is aborted and *CURLE_FILESIZE_EXCEEDED* is returned.
Passing a zero *size* disables this, and passing a negative *size* yields a
*CURLE_BAD_FUNCTION_ARGUMENT*.
-The file size is not always known prior to the download start, and for such
-transfers this option has no effect - even if the file transfer eventually
-ends up being larger than this given limit.
-
If you want a limit above 2GB, use CURLOPT_MAXFILESIZE_LARGE(3).
-Since 8.4.0, this option also stops ongoing transfers if they reach this
-threshold.
+If the size is known to be too big before the transfer starts, libcurl
+aborts before starting the transfer. If it is instead found to be too big
+while the transfer is in progress, libcurl aborts the transfer once the
+received bytes exceed the limit.
-Since 8.20.0, this option also stops ongoing transfers that would reach this
-threshold due to automatic decompression using CURLOPT_ACCEPT_ENCODING(3).
+Since 8.20.0, this option also aborts ongoing transfers once the
+decompressed bytes exceed this threshold due to automatic decompression using
+CURLOPT_ACCEPT_ENCODING(3).
# DEFAULT
@@ -68,6 +67,10 @@ int main(void)
# %AVAILABILITY%
+# HISTORY
+
+Before curl 8.4.0, the limit was not applied to transfers in progress.
+
# RETURN VALUE
curl_easy_setopt(3) returns a CURLcode indicating success or error.
docs/libcurl/opts/CURLOPT_MAXFILESIZE_LARGE.md+12 -11
@@ -29,18 +29,15 @@ CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAXFILESIZE_LARGE,
# DESCRIPTION
-Pass a curl_off_t as parameter. This specifies the maximum accepted *size*
-(in bytes) of a file to download. If the file requested is found larger than
-this value, the transfer is aborted and *CURLE_FILESIZE_EXCEEDED* is
-returned. Passing a zero *size* disables this, and passing a negative *size*
-yields a *CURLE_BAD_FUNCTION_ARGUMENT*.
+Pass a curl_off_t as parameter. This specifies the maximum accepted *size* (in
+bytes) of a file to download. If the file requested is found larger than this
+value, the transfer is aborted and *CURLE_FILESIZE_EXCEEDED* is returned.
+Passing a zero *size* disables this, and passing a negative *size* yields a
+*CURLE_BAD_FUNCTION_ARGUMENT*.
-The file size is not always known prior to the download start, and for such
-transfers this option has no effect - even if the file transfer eventually
-ends up being larger than this given limit.
-
-Since 8.4.0, this option also stops ongoing transfers if they reach this
-threshold.
+If the size is known to exceed the limit before the transfer starts, libcurl
+aborts before starting the transfer. If the transfer instead exceeds the limit
+while it is in progress, libcurl aborts it at that point.
Since 8.20.0, this option also stops ongoing transfers that would reach this
threshold due to automatic decompression using CURLOPT_ACCEPT_ENCODING(3).
@@ -70,6 +67,10 @@ int main(void)
# %AVAILABILITY%
+# HISTORY
+
+Before curl 8.4.0, the limit was not applied to transfers in progress.
+
# RETURN VALUE
curl_easy_setopt(3) returns a CURLcode indicating success or error.