CURLOPT_QUICK_EXIT(3)
π CURLOPT_QUICK_EXIT
okay so bestie, this one's from the libcurl crew β it lives in the Library Functions Manual section, and it's genuinely one of those tiny options that saves your whole vibe when you're bailing out of a program. no cap. π«Ά
β¨ NAME β¨
CURLOPT_QUICK_EXIT β literally just lets libcurl dip out fast π¨
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUICK_EXIT,
long value);
π DESCRIPTION π
So you pass a long as the parameter, and when it's 1L it means: when libcurl is recovering from a timeout, skip the lengthy cleanups. Those cleanups exist to avoid all kinds of leaks (threads and stuff, iykyk), but here's the thing β the caller program is about to call exit() anyway, so who even cares π
This is what gives you a swift termination after, say, a DNS timeout β by canceling and/or forgetting about a resolver thread. iconic behaviour, honestly. the trade-off? a possible (though short-lived) leak of associated resources. so likeβ¦ a tiny mess, but it's not gonna linger. π
β DEFAULT β
0
π¦ PROTOCOLS π¦
This functionality affects all supported protocols β every single one, bestie. π
π₯ EXAMPLE π₯
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_QUICK_EXIT, 1L);
result = curl_easy_perform(curl);
}
}
π AVAILABILITY π
Added in curl 7.87.0 β so if your curl is older than that, this option is a no-show, sorry babe π
π RETURN VALUE π
curl_easy_setopt(3) returns a CURLcode indicating success or error.
CURLE_OK (0) means everything was OK bestie π β non-zero means an error occurred, so go check libcurl-errors(3).
πΈ SEE ALSO πΈ
k that's the whole page, mwah π β brought to you by libcurl, dated 2026-10-12, straight out of the CURLOPT_QUICK_EXIT(3) manual. go forth and exit quickly, queen π§ββοΈβ¨
π¦ 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