From a676c18502d5ec3128db11accf04d6de3f9be949 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 17 Aug 2005 08:55:43 +0000 Subject: - Jeff Pohlmeyer found out that if you ask libcurl to load a cookiefile (with CURLOPT_COOKIEFILE), add a cookie (with CURLOPT_COOKIELIST), tell it to write the result to a given cookie jar and then never actually call curl_easy_perform() - the given file(s) to read was never read but the output file was written and thus it caused a "funny" result. - While doing some tests for the bug above, I noticed that Firefox generates large numbers (for the expire time) in the cookies.txt file and libcurl didn't treat them properly. Now it does. --- lib/transfer.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index 544ac8560..8f885f5d9 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -1641,25 +1641,9 @@ CURLcode Curl_pretransfer(struct SessionHandle *data) data->state.authhost.want = data->set.httpauth; data->state.authproxy.want = data->set.proxyauth; -#if !defined(CURL_DISABLE_HTTP) && !defined(CURL_DISABLE_COOKIES) - /* 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; - Curl_share_lock(data, CURL_LOCK_DATA_COOKIE, CURL_LOCK_ACCESS_SINGLE); - while(list) { - data->cookies = Curl_cookie_init(data, - list->data, - data->cookies, - data->set.cookiesession); - list = list->next; - } - Curl_share_unlock(data, CURL_LOCK_DATA_COOKIE); - curl_slist_free_all(data->change.cookielist); /* clean up list */ - data->change.cookielist = NULL; /* don't do this again! */ - } -#endif /* CURL_DISABLE_HTTP */ - + /* If there is a list of cookie files to read, do it now! */ + if(data->change.cookielist) + Curl_cookie_loadfiles(data); /* 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 -- cgit v1.2.3