mirror of
https://github.com/curl/curl.git
synced 2025-02-23 15:10:03 +08:00
curl: bail on cookie use when built with disabled cookies
This commit is contained in:
parent
5fe879555d
commit
47d760714f
@ -1071,21 +1071,23 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);
|
my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);
|
||||||
|
|
||||||
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
|
||||||
{
|
if(config->cookie)
|
||||||
/* TODO: Make this a run-time check instead of compile-time one. */
|
my_setopt_str(curl, CURLOPT_COOKIE, config->cookie);
|
||||||
|
|
||||||
if(config->cookie)
|
if(config->cookiefile)
|
||||||
my_setopt_str(curl, CURLOPT_COOKIE, config->cookie);
|
my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);
|
||||||
|
|
||||||
if(config->cookiefile)
|
/* new in libcurl 7.9 */
|
||||||
my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);
|
if(config->cookiejar)
|
||||||
|
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
|
||||||
|
|
||||||
/* new in libcurl 7.9 */
|
/* new in libcurl 7.9.7 */
|
||||||
if(config->cookiejar)
|
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
|
||||||
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);
|
#else
|
||||||
|
if(config->cookie || config->cookiefile || config->cookiejar) {
|
||||||
/* new in libcurl 7.9.7 */
|
warnf(config, "cookie option(s) used even though cookie support "
|
||||||
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
|
"is disabled!\n");
|
||||||
|
return CURLE_NOT_BUILT_IN;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user