cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: nonblocking sockets [PATCH]

From: Georg Horn <horn_at_koblenz-net.de>
Date: Mon, 7 Jan 2002 16:29:24 +0100

On Mon, Jan 07, 2002 at 04:00:33PM +0100, Daniel Stenberg wrote:
> On Mon, 7 Jan 2002, Daniel Stenberg wrote:
>
> > No, because the connect is made non-blocking and it probably returned
> > something saying that it isn't quite connected yet. We need to add code in
> > a manner similar to the regular connect for the SSL connection too, when
> > using non-blocking sockets.
>
> I've made an attempt to fix this. Could you please try the attached patch and
> see if this improves your situation?

Yes, it seems to work:

    $ src/curl -v --connect-timeout 1 https://meine.db24.de
    * Connected to meine.db24.de (193.150.167.1)
> GET / HTTP/1.1
    User-Agent: curl/7.9.2 (i686-pc-linux-gnu) libcurl 7.9.2 (OpenSSL 0.9.6)
    Host: meine.db24.de
    Pragma: no-cache
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

    curl: (23) SSL connection timeout
    * Closing connection #0

I'm just wondering why the "SSL connection timeout" appears after the
request that is going to be sent...? Or, why the request is printed at all
if the connection couldn't be established?

With a larger timeout value i get the correct result:

    $ src/curl -v --connect-timeout 2 https://meine.db24.de
    * SSL connection using RC4-MD5
    * Server certificate:
    * subject: /C=DE/ST=Hessen/L=Frankfurt/O=Deutsche Bank AG/OU=Deutsche Bank 24 AG/OU=Terms of use at www.verisign.com/RPA (c)00/CN=meine.db24.de
    * start date: 2001-06-13 00:00:00 GMT
    * expire date: 2002-07-13 23:59:59 GMT
    * common name: meine.db24.de (matched)
    * issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
    * Connected to meine.db24.de (193.150.167.1)
> GET / HTTP/1.1
    User-Agent: curl/7.9.2 (i686-pc-linux-gnu) libcurl 7.9.2 (OpenSSL 0.9.6)
    Host: meine.db24.de
    Pragma: no-cache
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*

    <HTML>
    <HEAD>
    [...]

Bye,
Georg
Received on 2002-01-07