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