cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Any plans for the next curl release

From: Shmulik Regev <shmulbox_at_gmail.com>
Date: Wed, 28 Feb 2007 16:40:25 +0200

Contrary to my original thoughts, the share object turned out to be a
problematic container for the cached SSL_CTX objects. Why? Because the
SSL_CTX objects are really used by the connection objects, which in turn may
outlive all the easy objects. Specifically, a SSL_CTX needs to be released (
i.e. returned to the cache and possibly freed) when the connection is about
to close (in the function Curl_ossl_close). Alas, at this point in time, the
connection can not rely on the existence of a valid easy handle and
therefore no way to reach the share object (which is referenced by the easy
objects).

There are a couple of ways around that, each with its own problems:
 1. the connection will keep a pointer to the share object
 2. the connection cache struct will manage the SSL_CTX cache and not the
share object
 3. keep a global lookup table mapping SSL_CTX objects to the relevant share
objects. I don't like this approach but it is an option

Any other ideas or preferences?

Cheers,
Shmul
Received on 2007-02-28