mirror of
https://github.com/curl/curl.git
synced 2026-08-13 01:20:55 +03:00
cookie: CURLOPT_COOKIEFILE set to NULL switches off cookies
Add test 676 to verify that setting CURLOPT_COOKIEFILE to NULL again clears the cookiejar from memory. Reported-by: Stefan Karpinski Fixes #6889 Closes #6891
This commit is contained in:
parent
566b74a0e1
commit
520bd5225c
6 changed files with 175 additions and 3 deletions
14
lib/setopt.c
14
lib/setopt.c
|
|
@ -752,6 +752,20 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
}
|
||||
data->state.cookielist = cl; /* store the list for later use */
|
||||
}
|
||||
else {
|
||||
/* clear the list of cookie files */
|
||||
curl_slist_free_all(data->state.cookielist);
|
||||
data->state.cookielist = NULL;
|
||||
|
||||
if(!data->share || !data->share->cookies) {
|
||||
/* throw away all existing cookies if this isn't a shared cookie
|
||||
container */
|
||||
Curl_cookie_clearall(data->cookies);
|
||||
Curl_cookie_cleanup(data->cookies);
|
||||
}
|
||||
/* disable the cookie engine */
|
||||
data->cookies = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case CURLOPT_COOKIEJAR:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue