mirror of
https://github.com/curl/curl.git
synced 2026-08-04 09:30:03 +03:00
urldata: move the cookefilelist to the 'set' struct
The cookiefile entries are set into the handle and should remain set for the lifetime of the handle so that duplicating it also duplicates the list. Therefore, the struct field is moved from 'state' to 'set'. Fixes #10133 Closes #10134
This commit is contained in:
parent
e4505a1915
commit
af5999a674
7 changed files with 24 additions and 37 deletions
12
lib/setopt.c
12
lib/setopt.c
|
|
@ -760,18 +760,18 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
|||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
/* append the cookie file name to the list of file names, and deal with
|
||||
them later */
|
||||
cl = curl_slist_append(data->state.cookielist, argptr);
|
||||
cl = curl_slist_append(data->set.cookielist, argptr);
|
||||
if(!cl) {
|
||||
curl_slist_free_all(data->state.cookielist);
|
||||
data->state.cookielist = NULL;
|
||||
curl_slist_free_all(data->set.cookielist);
|
||||
data->set.cookielist = NULL;
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
data->state.cookielist = cl; /* store the list for later use */
|
||||
data->set.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;
|
||||
curl_slist_free_all(data->set.cookielist);
|
||||
data->set.cookielist = NULL;
|
||||
|
||||
if(!data->share || !data->share->cookies) {
|
||||
/* throw away all existing cookies if this isn't a shared cookie
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue