Skip to content

Commit

Permalink
curl: bail on cookie use when built with disabled cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed May 6, 2014
1 parent 5fe8795 commit 47d7607
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/tool_operate.c
Expand Up @@ -1071,21 +1071,23 @@ static CURLcode operate_do(struct GlobalConfig *global,
my_setopt_slist(curl, CURLOPT_PREQUOTE, config->prequote);

#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES)
{
/* TODO: Make this a run-time check instead of compile-time one. */
if(config->cookie)
my_setopt_str(curl, CURLOPT_COOKIE, config->cookie);

if(config->cookie)
my_setopt_str(curl, CURLOPT_COOKIE, config->cookie);
if(config->cookiefile)
my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);

if(config->cookiefile)
my_setopt_str(curl, CURLOPT_COOKIEFILE, config->cookiefile);
/* new in libcurl 7.9 */
if(config->cookiejar)
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);

/* new in libcurl 7.9 */
if(config->cookiejar)
my_setopt_str(curl, CURLOPT_COOKIEJAR, config->cookiejar);

/* new in libcurl 7.9.7 */
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
/* new in libcurl 7.9.7 */
my_setopt(curl, CURLOPT_COOKIESESSION, config->cookiesession?1L:0L);
#else
if(config->cookie || config->cookiefile || config->cookiejar) {
warnf(config, "cookie option(s) used even though cookie support "
"is disabled!\n");
return CURLE_NOT_BUILT_IN;
}
#endif

Expand Down

0 comments on commit 47d7607

Please sign in to comment.