cURL / Mailing Lists / curl-library / Single Mail

curl-library

[patch] Ignore specific IPs in connections

From: Johan van Selst <johans_at_stack.nl>
Date: Wed, 5 Jan 2011 13:55:48 +0100

The attached patch adds an option to blacklist certain IP addresses for
a specific connection. I use this in an environment with many DNS
load-balanced webservers. Sometimes one of these servers consistently
throws errors (e.g. HTTP 500 Internal error), while others work fine.

Curl already does automatic fail-over to another address if a connection
is refused, but there is no way to connect to ignore a specific server
in a DNS load-balanced setup when it is reachable. With this patch one
can retry a request that failed to provide a usable result, while
'blacklisting' the specific address that produced this result. This way
one can still quickly get a sensible result from another server, unless
all of them fail.

The patch introduces the --ignoreip command-line option (may be repeated
with multiple addresses) and the CURLOPT_IGNORE_IPS library flag (takes
a string list). Suggestions for better names are welcome.

Ciao,
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-05