CURLOPT_MA...PEED_LARGE(3)

πŸ’… CURLOPT_MAX_RECV_SPEED_LARGE(3) ✨

okay so bestie, this page lives in the libcurl manual (Library Functions Manual, if we're being fancy πŸŽ€) β€” and the header got a lil truncated in your terminal so just know the full name is CURLOPT_MAX_RECV_SPEED_LARGE, k? slay.


🌸 NAME 🌸

CURLOPT_MAX_RECV_SPEED_LARGE β€” rate limit data download speed. that's it. that's the vibe check: we're capping how fast stuff comes down to you 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_MAX_RECV_SPEED_LARGE,
                          curl_off_t maxspeed);

✨ DESCRIPTION ✨

so you pass a curl_off_t as the parameter, okay? and if a download goes over this maxspeed β€” which is counted in bytes per second, no cap β€” the transfer just pauses a sec to keep the average speed less than or equal to whatever value you gave it. if you don't set anything, it defaults to unlimited speed. free real estate 🌈

lowkey important: this is not an exact science, bestie. libcurl attempts to keep the average speed below the given threshold over a period time. it's giving "we're trying our best" energy, not "surgical precision" energy 😭
also 🫢 if you set maxspeed to a value lower than CURLOPT_BUFFERSIZE(3), libcurl might download faster than the set limit initially. like yeah it might sprint out the gate before it calms down. it's fine. it's iconic.

and one thing that does not count: this option does not affect transfer speeds done with FILE:// URLs. local files said "we don't do rate limits here" πŸ’€


πŸŽ€ DEFAULT πŸŽ€

0, disabled β€” so by default: no limits, full send πŸ”₯


πŸ‘‘ PROTOCOLS πŸ‘‘

this functionality affects all supported protocols. every single one. periodt.


πŸ’– EXAMPLE πŸ’–

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
    /* cap the download speed to 31415 bytes/sec */
    curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t)31415);
    result = curl_easy_perform(curl);
  }
}

the way that 31415 is just sitting there being pi-ish? obsessed πŸ“


⭐ AVAILABILITY ⭐

Added in curl 7.15.5 β€” vintage. a classic. the main character of the 7.15.x era πŸ‘‘


πŸ’œ RETURN VALUE πŸ’œ

curl_easy_setopt(3) returns a CURLcode indicating success or error.

  • CURLE_OK (0) means everything was OK β€” we ate and left no crumbs ✨
  • non-zero means an error occurred β€” see libcurl-errors(3) for the whole saga πŸ™ˆ

🌈 SEE ALSO 🌈


k that's the whole page, go forth and throttle responsibly πŸ§šπŸ’«

β€” cute lil sign-off: this was libcurl, dated 2026-10-12, filed under CURLOPT_MA...PEED_LARGE(3) (yes the header is still doing that truncation thing, not me πŸ’€). mwah πŸ’‹

πŸ“¦ where this page comes from