cURL / Mailing Lists / curl-library / Single Mail

curl-library

thinking...

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

Hej

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, "ftp://cool.haxx.se/curl/");
    res = curl_easy_perform(curl);

    curl_easy_setopt(curl, CURLOPT_URL, "http://cool.haxx.se/");
    res = curl_easy_perform(curl);

    curl_easy_cleanup(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 -- http://curl.haxx.se/
_______________________________________________
Curl-library mailing list
Curl-library_at_lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/curl-library
Received on 2001-03-02