cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reusing CURL connection handles

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 10 Mar 2012 10:45:35 +0100 (CET)

On Fri, 9 Mar 2012, JonathonS wrote:

> I am using libcurl's easy interface. I've set all my options to the libcurl
> handle using curl_easy_setopt (including the URL to connect to).
>
> After I've setup everything up for my connection like the payload, timeout
> values, response callbacks, etc, if the connection fails, is it safe for me
> to just set the URL to another value and then do curl_easy_perform again?
> Or, must I cleanup the connection, setup all the values again, then set the
> new URL and then run curl_easy_perform?

It is safe to just set the options you want altered as they remain set to the
values you already set them to even after a transfer completed (successful or
not) and then curl_easy_perform() again!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-03-10