CURLOPT_LOW_SPEED_LIMIT(3)
π CURLOPT_LOW_SPEED_LIMIT(3) β the "girl, this transfer is too slow, wrap it up" option β¨
okay so real talk: this is a page from the Library Functions Manual, and it's about CURLOPT_LOW_SPEED_LIMIT(3) β the low speed limit, in bytes per second. yes bestie, we're doing throttle-detection today and it's actually iconic. π’π
πΈ NAME πΈ
CURLOPT_LOW_SPEED_LIMIT β low speed limit in bytes per second. that's it, that's the whole vibe check. π
β¨ SYNOPSIS β¨
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_LOW_SPEED_LIMIT,
long speedlimit);
so you're passing a long in as speedlimit and honestly that's the whole plot π«Ά
π DESCRIPTION π
okay so listen: you pass a long as the parameter. that number is the average transfer speed in bytes per second that the transfer should be below β for CURLOPT_LOW_SPEED_TIME(3) whole seconds β before libcurl goes "nope, this is too slow, I'm out" and aborts the transfer. π
like it's giving "if you're not gonna move at least this fast for this long, we're done here." main character boundary setting fr fr. π
π DEFAULT π
0, disabled β meaning by default nobody's judging your speed. no cap. π
π¦ PROTOCOLS π¦
this functionality affects all supported protocols. every single one. no one is exempt π
π₯ EXAMPLE π₯
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
/* abort if slower than 30 bytes/sec during 60 seconds */
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_TIME, 60L);
curl_easy_setopt(curl, CURLOPT_LOW_SPEED_LIMIT, 30L);
result = curl_easy_perform(curl);
if(CURLE_OPERATION_TIMEDOUT == result) {
printf("Timeout.\n");
}
/* always cleanup */
curl_easy_cleanup(curl);
}
}
see how CURLOPT_LOW_SPEED_TIME and CURLOPT_LOW_SPEED_LIMIT are besties here? 60 seconds + 30 bytes/sec = "if you're under 30 B/s for a full minute, we abort." and then we check for CURLE_OPERATION_TIMEDOUT like the queen we are. also don't forget curl_easy_cleanup(curl) β always cleanup, that comment is literally in the code for a reason π«Άβ¨
β AVAILABILITY β
added in curl 7.1. vintage. retro. still slaying. π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK(0) means everything was OK π- non-zero means an error occurred β go check
libcurl-errors(3)π
π SEE ALSO π
CURLOPT_LOW_SPEED_TIME(3)CURLOPT_MAX_RECV_SPEED_LARGE(3)CURLOPT_MAX_SEND_SPEED_LARGE(3)CURLOPT_TIMEOUT(3)
and that's the page!! mwah π signed off from libcurl, dated 2026-10-12 β go set your speed limits, bestie, and remember: slow transfers are not your fault but they are something you can abort on. π§ββοΈπ
π¦ 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