From 156aad198f4708f041fbe35ecfb18b875176317d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 17 Oct 2002 07:10:39 +0000 Subject: Make the COOKIESESSION work better by creating a list of cookie files files when given in the curl_easy_setopt() and then parse them all on the first curl_easy_perform() call instead. --- lib/transfer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/transfer.c') diff --git a/lib/transfer.c b/lib/transfer.c index 247e40286..198864c30 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -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! */ -- cgit v1.2.3