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 12--- 13 14# NAME 15 16CURLOPT_MAX_SEND_SPEED_LARGE - rate limit data upload speed 17 18# SYNOPSIS 19 20~~~c 21#include <curl/curl.h> 22 23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_SEND_SPEED_LARGE, 24 curl_off_t maxspeed); 25~~~ 26 27# DESCRIPTION 28 29Pass a curl_off_t as parameter with the *maxspeed*. If an upload exceeds 30this speed (counted in bytes per second) the transfer pauses to keep the 31average speed less than or equal to the parameter value. Defaults to unlimited 32speed. 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 38CURLOPT_UPLOAD_BUFFERSIZE(3), libcurl might "shoot over" the limit on 39its first send and still send off a full buffer. 40 41This option does not affect transfer speeds done with FILE:// URLs. 42 43# DEFAULT 44 450, disabled 46 47# EXAMPLE 48 49~~~c 50int main(void) 51{ 52 CURL *curl = curl_easy_init(); 53 if(curl) { 54 CURLcode ret; 55 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/"); 56 /* cap the upload speed to 1000 bytes/sec */ 57 curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)1000); 58 /* (set some upload options as well!) */ 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