1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_MAX_RECV_SPEED_LARGE
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_LOW_SPEED_LIMIT (3)
9  - CURLOPT_MAX_SEND_SPEED_LARGE (3)
10  - CURLOPT_TIMEOUT (3)
11Protocol:
12  - All
13---
14
15# NAME
16
17CURLOPT_MAX_RECV_SPEED_LARGE - rate limit data download speed
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE,
25                          curl_off_t maxspeed);
26~~~
27
28# DESCRIPTION
29
30Pass a curl_off_t as parameter. If a download exceeds this *maxspeed*
31(counted in bytes per second) the transfer pauses to keep the average speed
32less than or equal to the parameter value. Defaults to unlimited speed.
33
34This is not an exact science. libcurl attempts to keep the average speed below
35the given threshold over a period time.
36
37If you set *maxspeed* to a value lower than CURLOPT_BUFFERSIZE(3),
38libcurl might download faster than the set limit initially.
39
40This option does not affect transfer speeds done with FILE:// URLs.
41
42# DEFAULT
43
440, disabled
45
46# EXAMPLE
47
48~~~c
49int main(void)
50{
51  CURL *curl = curl_easy_init();
52  if(curl) {
53    CURLcode ret;
54    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
55    /* cap the download speed to 31415 bytes/sec */
56    curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)31415);
57    ret = curl_easy_perform(curl);
58  }
59}
60~~~
61
62# AVAILABILITY
63
64Added in 7.15.5
65
66# RETURN VALUE
67
68Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
69