cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi interface doesn't recognize when can't connect

From: Martin C. Martin <martin_at_metahuman.org>
Date: Fri, 14 Feb 2003 03:59:50 -0500

Daniel Stenberg wrote:
>
> So, if you do that fix (shown below as well), does it work as assumed for
> you?
>
> --- connect.c 4 Feb 2003 23:48:46 -0000 1.49
> +++ connect.c 14 Feb 2003 07:47:40 -0000
> @@ -409,6 +409,8 @@
> if(err)
> return CURLE_COULDNT_CONNECT;
> }
> + else if(2 == rc)
> + return CURLE_COULDNT_CONNECT;
>
> /*
> * If the connection phase is "done" here, we should attempt to connect

Yes. The only question is what to do if waitconnect() returns -1. That
happens if select() returns -1. I assume in that case you don't want to
keep calling select() over and over again, but rather signal an error.
So, the if should really be:

else if (2 == rc || -1 == rc)

or simply

else if (1 != rc)

While you're at it, you might want to change the comment above
waitconnect(), to mention that it can return 2 if there's an error.

Thanks Daniel! And thanks for cURL, it makes my life MUCH easier!

- Martin

-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
Received on 2003-02-14