Re: Q: about SSL_connect and sockfd in lib/ssluse.c
Date: Thu, 5 May 2005 13:33:49 +0200 (CEST)
On Thu, 5 May 2005, Alexander Lazic wrote:
> How about to set the socket to blocking an then call SSL_connect?
Sorry, but that would be to move in the totally wrong direction. The general
plan is to completely get rid of all blocking functions, and that requires
> Then it is possible to make the following:
> Curl_nonblock(sockfd, FALSE);
> ssl_handshake_duration = time(NULL)-start;
> Curl_nonblock(sockfd, TRUE);
This exact sequence is still possible using non-blocking sockets. The
SSL_connect() is completed once the while() loop is finished.
> and you don't need the while() loop anymore ;-))
It would have the _exact_ same problem, while admittingly using slightly less
The Correct Fix (tm) implies making sure that the function returns immediately
intead of looping and then having another function that checks for
completeness, so that multi.c can use that and have a separate state for SSL
connecting. That would then allow apps to use the multi interface without
"hanging" during the SSL connect phase.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.htmlReceived on 2005-05-05