cURL / Mailing Lists / curl-library / Single Mail


Re: patches: ares non blocking connect, libcurl ares sync resolve timeout [small correction and an addon]

From: Dirk Manske <>
Date: Mon, 2 Feb 2004 16:37:00 +0100

On Monday 02 February 2004 11:16, Daniel Stenberg wrote:
> Goodie. I've now committed a version that is supposed to do this...


Today I found a bug in my patch (and your commitment). Besides the connect also
ares_process can time out, than status is set to ARES_ETIMEOUT. So in Curl_wait_for_resolv
the line
        if(timedout) {
should be changed to
        if( timeouted || conn->async.status == ARES_ETIMEOUT ) {

And it would be nice to get more information if resolve failes. Is can easily done
in the following else block.
     char **dummy;
     failf(data, "Could not resolve host: %s cause: %s", conn->name, ares_strerror(conn->async.status,dummy) );

The dummy variable is needed but unused. Maybe it should be removed from ares_strerror.

BTW error message, I have found three different expressions for "time out":
>grep failf.*time *c
connect.c: failf(data, "Connection time-out");
connect.c: failf(data, "connect() timed out!");
ftp.c: failf(data, "Transfer aborted due to timeout");
hostip.c: failf(data, "name lookup timed out");
hostip.c: failf(data, "Resolving host timed out: %s", conn->name);
http.c: failf(data, "Proxy connection aborted due to timeout");
ssluse.c: failf(data, "SSL connection timeout");
transfer.c: failf (data, "Operation timed out with %Od out of %Od bytes received",

1. time-out
2. timed out
3. timeout

A litte mess.

And error messages while using http proxy are misleading. "Could not resolve host"
and "Could not connect" can apear for the proxy and the web host.
I hope I find the time to fix it this week.


The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
Received on 2004-02-02