cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [patch] Ignore specific IPs in connections

From: Johan van Selst <johans_at_stack.nl>
Date: Thu, 6 Jan 2011 08:59:45 +0100

Hi Daniel,

Daniel Stenberg wrote:
> I mean, say it gets a 500 back and it can figure out the IP that was used
> with curl_easy_getinfo(), but it can't know that the server had multiple
> addresses without doing some resolving itself, can it?. So will you then
> always block the IP with the failed 500-request and retry?

Yes, that is what I suggest. The application would use do this for hosts
for which it knows (well suspects) that there are multiple servers. The
new request wouldn't even trigger a real request: libcurl will figure
out that there are no addresses before it actually sends anything. The
application would then bassically get the same error that it would get
when all webservers in the IP list are down.

> There's not even a way for the app to figure out if all the IPs for the
> host name is blocked so when a single-IP host returns 500 and you block
> that, you can't connect anymore but you can't really tell the reason...

This is true. But the distinction doesn't really matter if none of the
IPs can provide a usable result anyway. If none of the servers are
usable, the application can return a fatal error and optionally reset
its IP blacklist. Still, in the case that *some* of the servers provide
a usable result and some don't, then this gives a real improvement.

> I'm still undecided about the feature in question, and I think learning
> more about the use case and ideas around it will help me and others get a
> better understanding and feel for it.

This was discussed in a thread here on 23 December ("Automatic retry
with server errors"). What I implemented is basically the solution you
suggested then, or rather a slight simplification of that. But if people
here can come up with better (cleaner) solutions, then that would be
very welcome.

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
Received on 2011-01-06