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