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