Loading lib/transfer.c +16 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,22 @@ CURLcode Curl_pretransfer(struct SessionHandle *data) data->state.this_is_a_follow = FALSE; /* reset this */ data->state.errorbuf = FALSE; /* no error has occurred */ /* If there was a list of cookie files to read and we haven't done it before, do it now! */ if(data->change.cookielist) { struct curl_slist *list = data->change.cookielist; while(list) { data->cookies = Curl_cookie_init(list->data, data->cookies, data->set.cookiesession); list = list->next; } curl_slist_free_all(data->change.cookielist); /* clean up list */ data->change.cookielist = NULL; /* don't do this again! */ } /* Allow data->set.use_port to set which port to use. This needs to be * disabled for example when we follow Location: headers to URLs using * different ports! */ Loading lib/url.c +7 −2 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ CURLcode Curl_close(struct SessionHandle *data) if (data->share) data->share->dirty--; if(data->change.cookielist) /* clean up list if any */ curl_slist_free_all(data->change.cookielist); if(data->state.auth_host) free(data->state.auth_host); Loading Loading @@ -552,8 +555,10 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...) */ cookiefile = (char *)va_arg(param, void *); if(cookiefile) data->cookies = Curl_cookie_init(cookiefile, data->cookies, data->set.cookiesession); /* append the cookie file name to the list of file names, and deal with them later */ data->change.cookielist = curl_slist_append(data->change.cookielist, cookiefile); break; case CURLOPT_COOKIEJAR: Loading lib/urldata.h +2 −0 Original line number Diff line number Diff line Loading @@ -582,6 +582,8 @@ struct DynamicStatic { bool proxy_alloc; /* http proxy string is malloc()'ed */ char *referer; /* referer string */ bool referer_alloc; /* referer sting is malloc()ed */ struct curl_slist *cookielist; /* list of cookie files set by curl_easy_setopt(COOKIEFILE) calls */ }; /* Loading Loading
lib/transfer.c +16 −0 Original line number Diff line number Diff line Loading @@ -1195,6 +1195,22 @@ CURLcode Curl_pretransfer(struct SessionHandle *data) data->state.this_is_a_follow = FALSE; /* reset this */ data->state.errorbuf = FALSE; /* no error has occurred */ /* If there was a list of cookie files to read and we haven't done it before, do it now! */ if(data->change.cookielist) { struct curl_slist *list = data->change.cookielist; while(list) { data->cookies = Curl_cookie_init(list->data, data->cookies, data->set.cookiesession); list = list->next; } curl_slist_free_all(data->change.cookielist); /* clean up list */ data->change.cookielist = NULL; /* don't do this again! */ } /* Allow data->set.use_port to set which port to use. This needs to be * disabled for example when we follow Location: headers to URLs using * different ports! */ Loading
lib/url.c +7 −2 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ CURLcode Curl_close(struct SessionHandle *data) if (data->share) data->share->dirty--; if(data->change.cookielist) /* clean up list if any */ curl_slist_free_all(data->change.cookielist); if(data->state.auth_host) free(data->state.auth_host); Loading Loading @@ -552,8 +555,10 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option, ...) */ cookiefile = (char *)va_arg(param, void *); if(cookiefile) data->cookies = Curl_cookie_init(cookiefile, data->cookies, data->set.cookiesession); /* append the cookie file name to the list of file names, and deal with them later */ data->change.cookielist = curl_slist_append(data->change.cookielist, cookiefile); break; case CURLOPT_COOKIEJAR: Loading
lib/urldata.h +2 −0 Original line number Diff line number Diff line Loading @@ -582,6 +582,8 @@ struct DynamicStatic { bool proxy_alloc; /* http proxy string is malloc()'ed */ char *referer; /* referer string */ bool referer_alloc; /* referer sting is malloc()ed */ struct curl_slist *cookielist; /* list of cookie files set by curl_easy_setopt(COOKIEFILE) calls */ }; /* Loading