curl-library
Re: Automatic retry with server errors
Date: Thu, 23 Dec 2010 15:49:48 +0100
Daniel Stenberg wrote:
> On Thu, 23 Dec 2010, Johan van Selst wrote:
>> However, it would be nice if libcurl could also connect automatically
>> to the next server if it gets an SSL authentication failure or an HTTP
>> 500 error code (i.e. one of the server is borked).
> HTTP 500 and SSL auth problems are very generic and even if you have a
> use for this exact case I bet others will want it done differently.
Yes, these were meant as examples. I'm sure any other HTTP (error)
response might signal a server-specific problem as well.
> What I mean is, I would like to come up with a way where libcurl returns
> the errors exactly like today and then allow the application to use the
> next round-robin IP address on a request that's reusing the same handle
> and host. If we can think of a way to accomplishes that cleanly.
That would work. We already get the IP of a successful connection with
CURLINFO_PRIMARY_IP: That might be used to set up a blacklist for a
later request.
How about an option such as CURLOPT_IGNORE_SERVER_IPS to pass a comma-
separated list of addresses that should not be used for a connection?
(Another option that already uses a comma-seperated list of server names
is CURLOPT_NOPROXY.)
It might be useful to have a CURLOPT_USE_SERVER_IPS as well, to force
the libcurl to use specific IP address(es), rather than having it use
DNS resolving and pick an arbitrary IP from the list of addresses
returned by DNS.
Regards,
Johan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/pgp-signature attachment: stored