cURL / Mailing Lists / curl-library / Single Mail


Re: Q: about SSL_connect and sockfd in lib/ssluse.c

From: Alexander Lazic <>
Date: Thu, 5 May 2005 13:25:48 +0200

On Don 05.05.2005 12:37, Daniel Stenberg wrote:
>On Thu, 5 May 2005, Alexander Lazic wrote:
>>I try to add some 'SSL-Timeings' around SSL_connect but for me the
>>blocking-mode for 'sockfd' isn't clear.
>>I have try to find out the blocking-mode of 'sockfd' but i'am not sure, is
>>the sockfd in non-blocking or in blocking state, at the moment when
>>SSL_connect is called?!
>The sockets are always set nonblocking when used within libcurl.
>That's also the reason for the while() loop for the OpenSSL connect.
>(And the loop itself is not very nice since it makes the function blocking,
>even when used from the multi interface...)

Well, thanks.

How about to set the socket to blocking an then call SSL_connect?

Then it is possible to make the following:

Curl_nonblock(sockfd, FALSE);
ssl_handshake_duration = time(NULL)-start;
Curl_nonblock(sockfd, TRUE);

and you don't need the while() loop anymore ;-))

What do you think about that?
What impact to the library could have these modification?!


al ;-)
Received on 2005-05-05