CURLOPT_SE...TIMEOUT_MS(3)
π CURLOPT_SE...TIMEOUT_MS(3) π
okay bestie, welcome to the Library Functions Manual page for libcurlβs CURLOPT_SERVER_RESPONSE_TIMEOUT_MS β aka the βhow long are we waiting for the server to text back before we assume it ghosted usβ setting. π This one is lowkey iconic for FTP-ish protocols and very βpatience, but make it timed.β β¨
π¦ NAME π¦
CURLOPT_SERVER_RESPONSE_TIMEOUT_MS β time allowed to wait for server response. literally the patience timer, but in milliseconds. β³π
π SYNOPSIS π
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SERVER_RESPONSE_TIMEOUT_MS,
long timeout);
πΈ DESCRIPTION πΈ
You pass a long. It tells libcurl to wait no longer than timeout milliseconds for responses on sent commands. If no response is received within this period, the connection is considered dead and the transfer fails. and thatβs the dramatic part, bestie β no response in time means the connection is declared dead and the transfer fails. πβ¨
It is recommended that if used in conjunction with CURLOPT_TIMEOUT(3), you set CURLOPT_SERVER_RESPONSE_TIMEOUT_MS(3) to a value smaller than CURLOPT_TIMEOUT(3). fr fr, keep this one under the bigger timeout so the vibe check makes sense. π«Ά
The maximum accepted value is 2147483648. thatβs the ceiling, no cap. π₯
This is the millisecond version of CURLOPT_SERVER_RESPONSE_TIMEOUT(3). same energy, smaller units. slay. π
π DEFAULT π
60000 milliseconds
thatβs the default, and yes it is giving βone minute of patience.β β³π
π PROTOCOLS π
This functionality affects ftp, imap, pop3, scp, sftp and smtp. iykyk. π¦
β¨ EXAMPLE β¨
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/slow.txt");
/* wait no more than 237 milliseconds */
curl_easy_setopt(curl, CURLOPT_SERVER_RESPONSE_TIMEOUT_MS, 237L);
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
not me obsessing over that 237L β tiny timeout, big main character energy. ππ
π§ AVAILABILITY π§
Added in curl 8.6.0
so if youβre on something older, itβs giving βnot invited to the group chat.β π
π 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, see libcurl-errors(3). periodt. π
π SEE ALSO π
CURLOPT_CONNECTTIMEOUT(3)CURLOPT_LOW_SPEED_LIMIT(3)CURLOPT_SERVER_RESPONSE_TIMEOUT(3)CURLOPT_TIMEOUT(3)
xoxo, source/version: libcurl π β date: 2026-10-12, page: CURLOPT_SE...TIMEOUT_MS(3). byeee π«ΆπΈ
π¦ 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