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 10:44:28 +0200

Daniel Stenberg <daniel_at_haxx.se> writes:

> On Wed, 8 Aug 2007, Nicolas KOWALSKI wrote:
>
>> $ 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!
>
> I can't my version do this... I guess digging into the code is the
> next step to figure this out!

FYI, I can reproduce this on my home server, Debian etch:

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

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

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

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

petole:~# curl -V
curl 7.15.5 (i486-pc-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8c
zlib/1.2.3 libidn/0.6.5
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz

Furthermore, on an oldie (SunOS 2.6), I have the same thing:

$ curl --verbose --max-time 5 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 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 -V
curl 7.16.0 (sparc-sun-solaris2.6) libcurl/7.16.0 OpenSSL/0.9.8d
zlib/1.1.4
Protocols: tftp ftp telnet dict ldap http file https ftps
Features: Largefile NTLM SSL libz

-- 
Nicolas
Received on 2007-08-08