cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl loop

From: Tyler Brock <tyler.brock_at_gmail.com>
Date: Thu, 23 Sep 2010 15:12:55 -0400

Still not working, used all of the provided advice in order to change the
loop. Any more ideas? Most recent version below:

static void run_custodian(ClientStruct *cs, int num_clients)
{
  curl_global_init(CURL_GLOBAL_ALL);
  char current_url[MAX_URL_SIZE];
  char buffer[CURL_ERROR_SIZE];
  CURL *ch = NULL;
  MemoryStruct data;

  ch = init_curl_handle(buffer);

  int i;
  for(i = 0; i < num_clients-3; i++)
     {
       init_ms(&data);
       //printf("Data is: %p\n", &data);

       init_mssb_specific(ch, cs[i]);
       //deletes all cookies
       curl_easy_setopt(ch, CURLOPT_COOKIELIST, "ALL" );
       curl_easy_setopt(ch, CURLOPT_COOKIESESSION, "TRUE");

       puts("logging in");
       build_mssb_login(current_url);
       curl_custodian(ch, buffer, &data, current_url);

       puts("getting holdings");
       build_mssb_url(current_url);
       curl_custodian(ch, buffer, &data, current_url);
       //print_ms(&data);
       print_ms_mssb(&data, cs[i]);

       if(data.memory) free(data.memory);
     }
  curl_easy_cleanup(ch);
}

-Tyler

Tyler J. Brock
(917)207-4043

On Wed, Sep 22, 2010 at 11:34 AM, Dan Fandrich <dan_at_coneharvesters.com>wrote:

> On Wed, Sep 22, 2010 at 10:57:39AM -0400, Tyler Brock wrote:
> > Dan, I think you are right and that this is the root of the issue. How do
> I
> > ensure the cookies are new on each run and I'm not caching the old ones?
>
> You want CURLOPT_COOKIELIST (or CURLOPT_COOKIESESSION).
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-09-23