1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_QUICK_EXIT
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_FAILONERROR (3)
9  - CURLOPT_RESOLVE (3)
10Protocol:
11  - All
12---
13
14# NAME
15
16CURLOPT_QUICK_EXIT - allow to exit quickly
17
18# SYNOPSIS
19
20~~~c
21#include <curl/curl.h>
22
23CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUICK_EXIT,
24                          long value);
25~~~
26
27# DESCRIPTION
28
29Pass a long as a parameter, 1L meaning that when recovering from a timeout,
30libcurl should skip lengthy cleanups that are intended to avoid all kinds of
31leaks (threads etc.), as the caller program is about to call exit() anyway.
32This allows for a swift termination after a DNS timeout for example, by
33canceling and/or forgetting about a resolver thread, at the expense of a
34possible (though short-lived) leak of associated resources.
35
36# DEFAULT
37
380
39
40# EXAMPLE
41
42~~~c
43int main(void)
44{
45  CURL *curl = curl_easy_init();
46  if(curl) {
47    CURLcode ret;
48    curl_easy_setopt(curl, CURLOPT_QUICK_EXIT, 1L);
49    ret = curl_easy_perform(curl);
50  }
51}
52~~~
53
54# AVAILABILITY
55
56Added in 7.87.0
57
58# RETURN VALUE
59
60Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
61