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