On Mon, Nov 06, 2000 at 03:50:02PM +0100, Stephane Bortzmeyer wrote:
> I have a program (whose purpose is to test and benchmark Web servers) which 
> can loop over a given server. During the loop, what should I close/free? Since 
> there is apparently no documentation of the API (if I'm wrong, I pay a beer 
> for any pointer to actual documentation), I wonder if I should:

New manual pages are added over time. Please get a latest snapshot or access
the online documentation on www.openssl.org; there are links at the bottom
of the ssl(3) manual page...

>   SSL_free (ssl);
>   SSL_CTX_free (ctx);
> 
> at every iteration or not? May I safely reuse contexts?
You can and should safely reuse a SSL_CTX object, so that you don't need to
reinitialize things like the certificate stuff.
An SSL object can also be reused, you should however make sure to call
SSL_clear() on it before reuse.
I cannot give you numbers on the performance impact of SSL_new() or
SSL_CTX_new(), respectively. Both functions do however call functions
of the malloc() class quite often, so that memory fragmentation might
occur. For this reason alone, I would already recommend you to reuse SSL
and SSL_CTX objects.

Best regards,
        Lutz
-- 
Lutz Jaenicke                             [EMAIL PROTECTED]
BTU Cottbus               http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik                  Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus              Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to