cURL / Mailing Lists / curl-library / Single Mail

curl-library

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

From: Alexander Lazic <al-curllibrary_at_none.at>
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:

<pseudocode>
Curl_nonblock(sockfd, FALSE);
start=time(NULL);
SSL_connect();
ssl_handshake_duration = time(NULL)-start;
Curl_nonblock(sockfd, TRUE);
</pseudocode>

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

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

greetings

al ;-)
Received on 2005-05-05