cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: getopt

From: Brian Dessent <brian_at_dessent.net>
Date: Thu, 12 Oct 2006 22:22:44 -0700

Richard Levenberg wrote:

> I have an application where I dont want to store the URL after putting
> into the curl library. i.e.
>
> curl_easy_init();
> curl_easy_setopt(CURLOPT_URL, url);
>
> where url is a malloc'ed pointer to chars. If the notion of the options

You can't not "store the URL after putting into the curl library"
because how else is libcurl to be able to know what the URL is, if it
does not make a copy of the data? What you really mean is "I would like
to do no bookkeeping other than the curl handle, and be able to retrieve
the char * of the URL so I can free it after shutting down." For that
you can use CURLINFO_PRIVATE.

> being set for all subsequent calls to perform, why can't I store the
> pointer and retrieve it with something like curl_easy_getopt to retrieve
> the pointer and free it myself.

That is precisely what CURLINFO_PRIVATE gives you.

> I was way too tired to go searching through the archives. <rant mode>why
> dont't these mailing programs provide a search option to search through
> all the archives?</rant mode>

What the heck are you talking about?

http://curl.haxx.se/mail/list.cgi?list=curl-users
http://marc.theaimsgroup.com/?l=curl-library&r=1&w=2
http://dir.gmane.org/gmane.comp.web.curl.library

You can search the archives at any of those sites, and probably others
on the net.

Brian
Received on 2006-10-13