|
|
cURL Mailing List Monthly Index Single Mail
curl-tracker Archives
[ curl-Bugs-3140454 ] Curl_connecthost fails to try multiple addresses
From: SourceForge.net <noreply_at_sourceforge.net>
Date: Sun, 26 Dec 2010 21:58:09 +0000
Bugs item #3140454, was opened at 2010-12-20 02:16
Please note that this message will contain a full copy of the comment thread,
Initial Comment:
Suppose I have a host 'foo' that resolves to 2 IP addresses, the first of which cannot be connected to (because the host is down). If I attempt to retrieve an HTTP resource from the host, curl behaves differently if CURLOPT_TIMEOUT or CURLOPT_CONNECTTIMEOUT is set, depending on which interface is used.
If I use curl_easy_perform() to retrieve the resource, the timeout is divided by the number of hosts and each IP is tried in turn. This is the behavior I believe most users anticipate:
$ curl -v --max-time 10 http://foo/
But if I use curl_multi_perform() to retrieve the resource, curl does not fail over to the other IP at all, if the specified timeout is less than the system's default connect timeout. Instead, it continues to wait for the connection to the first address to complete and then returns an error when the specified timeout was reached:
#!/usr/bin/perl
$ perl curltest.pl
If I remove the 'timeout => 10' from the script above, we see:
$ perl curltest.pl
----------------------------------------------------------------------
Comment By: Daniel Stenberg (bagder)
Message:
To try it out, you either checkout/update your git clone:
or you try tomorrow's daily snapshot: http://curl.haxx.se/snapshots/
----------------------------------------------------------------------
You can respond by visiting:
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info