cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libCurl 7.18.1: Maybe busy waiting during creation of tunnel through proxy for SSL data ?

From: Stefan Krause <stefan.krause_at_gmx.net>
Date: Wed, 07 May 2008 23:02:39 +0200

> I think the problem is that the code is simply waiting for the socket
> to become writeable (as you saw), while in reality it should wait for
> it to become readable after it has sent its CONNECT request.
>
> My (untested) attempt at fixing this follows:
>
> diff -u -r1.168 multi.c
> --- lib/multi.c 30 Apr 2008 21:20:09 -0000 1.168
> +++ lib/multi.c 6 May 2008 21:33:40 -0000
> @@ -725,6 +725,12 @@
> return GETSOCK_BLANK;
>
> sock[0] = conn->sock[FIRSTSOCKET];
> +
> + /* when we've sent a CONNECT to a proxy, we should rather wait for the
> + socket to become readable to be able to get the response headers */
> + if(conn->bits.tunnel_connecting)
> + return GETSOCK_READSOCK(0);
> +
> return GETSOCK_WRITESOCK(0);
> }
>
>

Hello Daniel,

thanks for your patch. I'll try to test it tomorrow and then give you
feedback.

Stefan
Received on 2008-05-07