mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:13:38 +03:00
CURLOPT_QUICK_EXIT: don't wait for DNS thread on exit
Fixes #2975 Closes #9147
This commit is contained in:
parent
b473df52bb
commit
49798cac83
11 changed files with 87 additions and 2 deletions
|
|
@ -534,7 +534,8 @@ void Curl_resolver_kill(struct Curl_easy *data)
|
|||
/* If we're still resolving, we must wait for the threads to fully clean up,
|
||||
unfortunately. Otherwise, we can simply cancel to clean up any resolver
|
||||
data. */
|
||||
if(td && td->thread_hnd != curl_thread_t_null)
|
||||
if(td && td->thread_hnd != curl_thread_t_null
|
||||
&& (data->set.quick_exit != 1L))
|
||||
(void)thread_wait_resolv(data, NULL, FALSE);
|
||||
else
|
||||
Curl_resolver_cancel(data);
|
||||
|
|
|
|||
|
|
@ -242,6 +242,7 @@ struct curl_easyoption Curl_easyopts[] = {
|
|||
CURLOT_STRING, 0},
|
||||
{"PROXY_TRANSFER_MODE", CURLOPT_PROXY_TRANSFER_MODE, CURLOT_LONG, 0},
|
||||
{"PUT", CURLOPT_PUT, CURLOT_LONG, 0},
|
||||
{"QUICK_EXIT", CURLOPT_QUICK_EXIT, CURLOT_LONG, 0},
|
||||
{"QUOTE", CURLOPT_QUOTE, CURLOT_SLIST, 0},
|
||||
{"RANDOM_FILE", CURLOPT_RANDOM_FILE, CURLOT_STRING, 0},
|
||||
{"RANGE", CURLOPT_RANGE, CURLOT_STRING, 0},
|
||||
|
|
@ -369,6 +370,6 @@ struct curl_easyoption Curl_easyopts[] = {
|
|||
*/
|
||||
int Curl_easyopts_check(void)
|
||||
{
|
||||
return ((CURLOPT_LASTENTRY%10000) != (321 + 1));
|
||||
return ((CURLOPT_LASTENTRY%10000) != (322 + 1));
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -3116,6 +3116,9 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
case CURLOPT_QUICK_EXIT:
|
||||
data->set.quick_exit = (0 != va_arg(param, long)) ? 1L:0L;
|
||||
break;
|
||||
default:
|
||||
/* unknown tag and its companion, just ignore: */
|
||||
result = CURLE_UNKNOWN_OPTION;
|
||||
|
|
|
|||
|
|
@ -655,6 +655,7 @@ CURLcode Curl_init_userdefined(struct Curl_easy *data)
|
|||
#endif
|
||||
;
|
||||
Curl_http2_init_userset(set);
|
||||
set->quick_exit = 0L;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1826,6 +1826,10 @@ struct UserDefined {
|
|||
/* Here follows boolean settings that define how to behave during
|
||||
this session. They are STATIC, set by libcurl users or at least initially
|
||||
and they don't change during operations. */
|
||||
BIT(quick_exit); /* set 1L when it is okay to leak things (like
|
||||
threads), as we're about to exit() anyway and
|
||||
don't want lengthy cleanups to delay termination,
|
||||
e.g. after a DNS timeout */
|
||||
BIT(get_filetime); /* get the time and get of the remote file */
|
||||
BIT(tunnel_thru_httpproxy); /* use CONNECT through an HTTP proxy */
|
||||
BIT(prefer_ascii); /* ASCII rather than binary */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue