cURL / Mailing Lists / curl-library / Single Mail



From: Daniel Stenberg <>
Date: Fri, 2 Mar 2001 08:53:27 +0100 (MET)


I have some more thoughts about the upcoming persistant connection support. I
thought I'd bounce some ideas around here to see what you have to say!

With the new support in 7.7, libcurl will be able to do multiple serial
requests using the same curl handle. This will make a program like this work:

 curl = curl_easy_init();
 if(curl) {
    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
    curl_easy_setopt(curl, CURLOPT_HEADER, 1);

    curl_easy_setopt(curl, CURLOPT_URL, "");
    res = curl_easy_perform(curl);

    curl_easy_setopt(curl, CURLOPT_URL, "");
    res = curl_easy_perform(curl);


Now, as you can see, the options you set for the first transfer are also used
for the second transfer.

Is this good? Should I go back to a default setup after each transfer? Or
should I perhaps add an interface that allows you to tell curl to do so?

I forsee that this might become an area in which people will generally make
errors, as you have to explicitly switch off things you switched on earlier
if you don't want them for all transfers on that same handle.

You generally will want to use the same handle, as that is what enables
persistant connections.

  Daniel Stenberg -- curl project maintainer --
Curl-library mailing list
Received on 2001-03-02