cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Errors without description (CURLOPT_ERRORBUFFER)

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 19 Sep 2004 16:27:17 +0200 (CEST)

On Sun, 19 Sep 2004, Andreas Rieke wrote:

> In case of an error code (result != CURLE_OK), I did find an error
> description in the buffer I passed with the CURLOPT_ERRORBUFFER with
> previous versions (7.12.0 and earlier) of cURL. In the new version, this is
> not always the case. If a try a connection to an invalid host name, I get a
> very precise description, but if I try to connect to a host/port where no
> server ist running, the buffer is just empty in the new version.

Thanks for this description! This bug was probably introduced when we rewrote
the whole name resolve code for 7.12.1 and thus the connect loop was unified
and changed...

This patch seems to fix this particular flaw in my end:

diff -u -r1.114 connect.c
--- lib/connect.c 4 Aug 2004 12:38:01 -0000 1.114
+++ lib/connect.c 19 Sep 2004 14:27:22 -0000
@@ -745,6 +745,7 @@
    if (sockfd == CURL_SOCKET_BAD) {
      /* no good connect was made */
      *sockconn = CURL_SOCKET_BAD;
+ failf(data, "couldn't connect to host");
      return CURLE_COULDNT_CONNECT;
    }

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-09-19