> Hi Marek Marcola > > I do the following: > 1. Create ctx > 2. Create ssl= new (ctx,...) > 3. printf ( " Number of ssl %d", ctx->references) > > Step 3 show me 2 instead of 1 ( I only have one socket ssl with ctx). > Why ?? Please kindly help me.
Your question is baffling to me. How could it possibly be one? I'm not sure how to reply because I can't imagine why you would possibly think it should be one. There are currently two completely independent code streams that have access to this context. One is the code stream that created and used it to create that SSL session and could use it to create more SSL sessions. The other is the SSL session you created in step 2 and that will continue to use the context. Each of those things has to hold a reference to the context. If the session didn't hold a reference, the context could go away while that session was still active. If the code that created the context didn't hold a reference to it, the context could go away just as it tries to create another SSL session using that context. Any code that's permitted to rely on a context continuing to exist should hold a reference to it. Clearly the code that created the SSL session using that context is relying on the context continuint to exist and equally clearly the SSL session so creating is relying on the same thing. DS ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]