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: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 6 May 2008 23:42:58 +0200 (CEST)

On Tue, 6 May 2008, Stefan Krause wrote:

> Any thoughts what might be the problem or were to look next ?

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);
  }

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-05-06