cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: connect-timeout not working

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 4 Jan 2002 12:46:31 +0100 (MET)

On Fri, 4 Jan 2002, Georg Horn wrote:

> So a connect with a non-blocking socket should immediately return with an
> errno of EWOULDBLOCK and you can then wait for the connection with
> select()?

Yes.

> Cool, i always thought, that this non-blocking effect would only be usable
> for read()s after a connection has been established...

We switch back to blocking sockets again, after the connect is done. We
should probably consider not doing that switch back...

> After looking over it again, i think that it hangs somewhere during the
> SSL- handshake, because i get error messages like this:
>
> curl: (35) SSL: error:00000000::lib(0) :func(0) :reason(0)
>
> So the connect() seems to work fine, but it hangs somewhere in the SSL-lib
> and never returns. Any idea, how to solve this?

Uh. Not right now (need to study related OpenSSL stuff first). Can you make
sure that this is really the case?

> Do the ssl-functions have an option to set a timeout, or should we turn off
> signals after the dnslookup, and turn them on again before doing the ssl
> stuff?

Using signals is not a good solution. Using non-blocking sockets might be
better, as then OpenSSL shouldn't be able to hang either.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-01-04