cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: max-time and connect-timeout options, results varying

From: Nicolas KOWALSKI <nicolas.kowalski_at_gmail.com>
Date: Wed, 08 Aug 2007 09:34:59 +0200

Nicolas KOWALSKI <nicolas.kowalski_at_gmail.com> writes:

> Daniel Stenberg <daniel_at_haxx.se> writes:
>
>> On Tue, 7 Aug 2007, Nicolas KOWALSKI wrote:
>>
>>> I have some problems understanding why using the same command
>>> multiple times against a site, which *is* down, gives me varying
>>> results.
>>
>> Me too!
>>
>>> curl 7.12.1 (i386-redhat-linux-gnu) libcurl/7.12.1 OpenSSL/0.9.7a
>>> zlib/1.2.1.2 libidn/0.5.6
>>
>> In three days that version celebrates its third birthday. Perhaps it
>> is time to consider an update?
>
> Rant...In my company, this RHEL system is considered quite new... ;-)
>
> Ok, I will compile a new version, and re-check the behaviour.

With a newer curl, I notice the same varying results. Here is a sample run:

$ curl --verbose --max-time 5 --connect-timeout 0 http://10.10.10.10/
* About to connect() to 10.10.10.10 port 80 (#0)
* Trying 10.10.10.10... Timeout
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

$ curl --verbose --max-time 5 --connect-timeout 0 http://10.10.10.10/
* About to connect() to 10.10.10.10 port 80 (#0)
* Trying 10.10.10.10... Timeout
* connect() timed out!
* Closing connection #0
curl: (28) connect() timed out!

$ curl --verbose --max-time 5 --connect-timeout 0 http://10.10.10.10/
* About to connect() to 10.10.10.10 port 80 (#0)
* Trying 10.10.10.10... Timeout
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host

The curl used is:
$ curl -V
curl 7.16.4 (i686-redhat-linux-gnu) libcurl/7.16.4 OpenSSL/0.9.7a
zlib/1.2.1.2
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: Largefile NTLM SSL libz

Thanks,

-- 
Nicolas
Received on 2007-08-08