GNURLOPT_MAX_SEND_SPEED_LARGE(3)
π GNURLOPT_MAX_SEND_SPEED_LARGE(3) π
okay so bestie, this page lives in the curl_easy_setopt options part of the gnurl manual β it's the one titled GNURLOPT_MAX_SEND_SPEED_LARGE(3), and it's literally all about not letting your uploads go feral. π
β¨ NAME β¨
CURLOPT_MAX_SEND_SPEED_LARGE β rate limit data upload speed π¦
π SYNOPSIS π
#include <gnurl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_SEND_SPEED_LARGE,
curl_off_t maxspeed);
π¦ DESCRIPTION π¦
You pass a curl_off_t in as the maxspeed. If an upload ever exceeds that speed (and yes, it's counted in bytes per second), the transfer will pause so the speed stays less than or equal to whatever value you handed over. Defaults to unlimited speed, iykyk. π
Heads up though β this is not an exact science. libcurl attempts to keep the average speed below the given threshold over a period of time. So it's giving "best effort," not "precision instrument." π
And if you set maxspeed to a value lower than CURLOPT_UPLOAD_BUFFERSIZE(3), libcurl might "shoot over" the limit on its first send and still send off a full buffer. Ngl, it happens. π
Also important: this option doesn't affect transfer speeds done with FILE:// URLs. Periodt.
πΈ DEFAULT πΈ
0, disabled β¨
π PROTOCOLS π
All except file:// π«
π₯ EXAMPLE π₯
CURL *curl = curl_easy_init();
if(curl) {
CURLcode ret;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
/* cap the upload speed to 1000 bytes/sec */
curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t)1000);
/* (set some upload options as well!) */
ret = curl_easy_perform(curl);
}
β AVAILABILITY β
Added in 7.15.5 π
π RETURN VALUE π
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. Simple as that, bestie. π«Ά
π§ SEE ALSO π§
okay that's the whole page, no cap π
β this was brought to you by libcurl 7.37.0, dated 19 Jun 2014, from the GNURLOPT_M...SPEED_LARGE(3) corner of the manual. go throttle those uploads responsibly, mwah πβ¨
π¦ where this page comes from
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms