CURLOPT_MA...PEED_LARGE(3)
π NAME (who dis)
CURLOPT_MAX_SEND_SPEED_LARGE β the rate limit for how fast your stuff uploads, bestie β¨
πΈ SYNOPSIS (the vibe code)
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_SEND_SPEED_LARGE,
curl_off_t maxspeed);
π DESCRIPTION (the tea)
okay so, you pass a curl_off_t as the maxspeed parameter. And like β if an upload exceeds this speed (counted in bytes per second, keep up π«Ά) then the transfer literally pauses to keep the average speed less than or equal to whatever value you handed it. Defaults to unlimited speed, because free spirit energy π.
ngl, this is not an exact science. libcurl attempts to keep the average speed below the given threshold over a period time. periodt, that's the whole deal.
and here's the lil gotcha π β 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. so don't come for it, it warned you π
also!! this option does not affect transfer speeds done with FILE:// URLs. local files stay speedy, no cap πββοΈ
π DEFAULT (the out-of-the-box situation)
0, disabled β literally no speed cap, unlimited, go off π
π¦ PROTOCOLS (who this works on)
This functionality affects all supported protocols π every single one, no gatekeeping.
β¨ EXAMPLE (copy paste era)
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
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) */
result = curl_easy_perform(curl);
}
}
π· AVAILABILITY (when she dropped)
Added in curl 7.15.5 β vintage icon behavior, lowkey iconic π°οΈ
π RETURN VALUE (what you get back)
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK π- non-zero means an error occurred π β see
libcurl-errors(3)for the deets
π SEE ALSO (the besties)
okay that's the whole page, mwah π this was the libcurl Library Functions Manual, dated 2026-10-12 β go forth and throttle responsibly, bestie π«Άβ¨
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms