cURL / Mailing Lists / curl-library / Single Mail


Curl_ossl_connect is blocking

From: Xavier Bouchoux <>
Date: Mon, 13 Mar 2006 15:06:09 +0100


I noticed that Curl_ossl_connect doesn't return until the connection is
fully negotiated, and blocks on select calls.
Which is a bit unfortunate when using the multi interface to manage several
transfers at the same time as well as having the rest of the program
continuing to respond.
(I observed the program being blocked for 3-4 seconds..)

So I have been looking into making https connections non blocking.

My plan is to make a Curl_http_connecting() in addition to
Curl_http_connect(), that would deal with the ssl negotiation, so that the
connection will be in the "CURLM_STATE_PROTOCONNECT" during this phase.

is this the correct way, or should I try to extend Curl_http_connect() so
that the ssl is done when it completes. (and thus staying in

Moreover I fail to understand in the simple case (ie not "multi" case) when
this function is called. (I mean, in url.c SetupConnection(),
curl_protocol_connect() is called and then the value of protocol_done is
ignored all the way to the initial caller and curl_protocol_connecting()
never seems to be called.
how should it work in that case?

Received on 2006-03-13