cURL / Mailing Lists / curl-users / Single Mail


Re: Patch to initialize errorbuffer, makefile.dist for vc

From: Daniel Stenberg <>
Date: Thu, 22 Nov 2001 00:06:35 +0100 (MET)

On Wed, 21 Nov 2001, SM wrote:

> When cURL cannot connect to a site, it returns an error 7 and prints the
> contents of errorbuffer. The errorbuffer isn't initialized beforehand.
> I made a patch to src/main.c to fix that. This should avoid any funny
> characters from being displayed when the contents of errorbuffer is not
> set.

Correct, we should not do that. I did however settle with only setting the
first byte to zero.

In similar spirit, we should make sure to always return a human readable
error description when returning errors. The situation here should not occur!

In this particular case, I believe this patch will do:

--- connect.c 2001/10/31 08:44:11 1.15
+++ connect.c 2001/11/21 22:57:42 1.16
@@ -542,6 +542,7 @@
     /* no good connect was made */
     *sockconn = -1;
+ failf(data, "Couldn't connect to host");

> Daniel, please apply the patch the src if you find it correct. I'm not
> sure whether previous version of cURL were displaying a verbose error
> such as "cannot connect to hostname".

The connect code was changed in 7.9.1 so this was not the same case in
previous versions.

> I also made two changes to the makefile.dist in the root cURL directory.
> The lib/makefile.vc6 requires a cfg=build-version switch. I modified the
> parameters for the command line build to work with VC.

I applied them too!


    Daniel Stenberg -- curl groks URLs --
Received on 2001-11-22