cURL / Mailing Lists / curl-library / Single Mail

curl-library

incorrect error messages on timeouts

From: Ryan Braud <rbraud_at_gmail.com>
Date: Thu, 22 May 2014 10:25:56 -0700

Hi, I've noticed that curl now displays some "incorrect" error messages
when a timeout is given and hit. For example:

http://www.gebiz.gov.sg, timeout 1 s
LD_LIBRARY_PATH=../../lib/.libs ./curl -w "@curl-format" -v -L -m 1
http://www.gebiz.gov.sg
* Rebuilt URL to: http://www.gebiz.gov.sg/
* Hostname was NOT found in DNS cache
* Trying 160.96.179.103...
* Trying 2402:8d03:ffef:ff7f:a0:60b3:6700:0...
* Immediate connect fail for 2402:8d03:ffef:ff7f:a0:60b3:6700:0: Network is
unreachable
* Connected to www.gebiz.gov.sg (160.96.179.103) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.0-DEV
> Host: www.gebiz.gov.sg
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Length: 15370
< Content-Type: text/html
< Content-Location: http://www.gebiz.gov.sg/partner_login.html
< Last-Modified: Mon, 12 May 2014 09:20:58 GMT
< Accept-Ranges: bytes
< ETag: "fdb0f27bc36dcf1:1f39"
< Date: Thu, 22 May 2014 17:12:50 GMT
<

...
<TRANSFERRED CONTENT REMOVED FROM OUTPUT>
...

* Operation timed out after 841 milliseconds with 6548 out of 15370 bytes
received
* Closing connection 0
         <td height="20" valign="bottom"
background="image/horizontal_lines_tri.gif" class="font10"><b> <img
src="image/clear.gif" width="5" height="16" border="0"
align="absbottom">Business Alerts</
            time_namelookup: 0.012
               time_connect: 0.217
            time_appconnect: 0.000
           time_pretransfer: 0.217
              time_redirect: 0.000
         time_starttransfer: 0.430
                            ----------
                 time_total: 1.000

curl: (28) Operation timed out after 841 milliseconds with 6548 out of
15370 bytes received

I find it odd that the time listed in the timeout is 841 milliseconds,
rather than 1 second, which was what was specified.

Example 2, which is more egregious:
LD_LIBRARY_PATH=../../lib/.libs ./curl -w "@curl-format" -v -L -m 3
http://mega.co.nz
* Rebuilt URL to: http://mega.co.nz/
* Hostname was NOT found in DNS cache
* Trying 154.53.224.146...
* Connected to mega.co.nz (154.53.224.146) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.37.0-DEV
> Host: mega.co.nz
> Accept: */*
>
< HTTP/1.1 302 Found
< Content-Length: 0
< Location: https://mega.co.nz/
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Headers: MEGA-Chrome-Antileak
< Access-Control-Max-Age: 86400
< Connection: Keep-Alive
<
* Connection #0 to host mega.co.nz left intact
* Issue another request to this URL: 'https://mega.co.nz/'
* Found bundle for host mega.co.nz: 0x1687a70
* Hostname was NOT found in DNS cache
* Trying 154.53.224.150...
* Connected to mega.co.nz (154.53.224.150) port 443 (#1)
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: none
* SSLv3, TLS handshake, Client hello (1):
* Operation timed out after 0 milliseconds with 0 out of 0 bytes received
* Closing connection 1

            time_namelookup: 0.012
               time_connect: 0.171
            time_appconnect: 0.000
           time_pretransfer: 0.000
              time_redirect: 0.327
         time_starttransfer: 0.000
                            ----------
                 time_total: 4.002

curl: (28) Operation timed out after 0 milliseconds with 0 out of 0 bytes
received

In this case, the connection stalls after sending the Client hello (only on
that specific IP address though, 154.53.224.150). I seem to recall curl
7.22 returning an SSL connection timeout message, but now we get this
instead. The OTHER strange thing is that this takes 4 seconds, although I
have specified a timeout of 3 here. I haven't tried trying to bisect curl
versions to see when this started happening, but I did try 7.35 and it is
present there too.

Ryan

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-05-22