CURLOPT_QUICK_EXIT.3 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. .\" generated by cd2nroff 0.1 from CURLOPT_QUICK_EXIT.md
  2. .TH CURLOPT_QUICK_EXIT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_QUICK_EXIT \- allow to exit quickly
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_QUICK_EXIT,
  9. long value);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long as a parameter, 1L meaning that when recovering from a timeout,
  13. libcurl should skip lengthy cleanups that are intended to avoid all kinds of
  14. leaks (threads etc.), as the caller program is about to call exit() anyway.
  15. This allows for a swift termination after a DNS timeout for example, by
  16. canceling and/or forgetting about a resolver thread, at the expense of a
  17. possible (though short\-lived) leak of associated resources.
  18. .SH DEFAULT
  19. 0
  20. .SH PROTOCOLS
  21. This functionality affects all supported protocols
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. CURLcode ret;
  29. curl_easy_setopt(curl, CURLOPT_QUICK_EXIT, 1L);
  30. ret = curl_easy_perform(curl);
  31. }
  32. }
  33. .fi
  34. .SH AVAILABILITY
  35. Added in curl 7.87.0
  36. .SH RETURN VALUE
  37. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  38. .SH SEE ALSO
  39. .BR CURLOPT_FAILONERROR (3),
  40. .BR CURLOPT_RESOLVE (3)