One could make a singleton of OpenSSL_add_all_algorithms() (or rather, the two functions it calls), but it would lead to problems if EVP_cleanup() is called and one would want to reinitialise the object database.
A different solution would be to make the OBJ_* functions thread-safe (make them use a lock), but that will not be possible in 0.9.6x since that generates incompatible changes in some arrays (I believe). I would prefer to go the locking way. Comments, anyone? [[EMAIL PROTECTED] - Fri May 17 21:24:32 2002]: > Hi: > > I´m having ugly crashes in Win32 when I call several times > OpenSSL_add_all_algoritms(), mainly when I use my C code from > Visual Basic but also if I use several DLLs. > The problem comes up if I call that funcion from several C DLLs to > initialize library. > I think that it would be useful to have an static variable inside > OpenSSL_add_all_algoritms(), in such a way initialized that only > one time the initialize is made.This way , no matter how many times > from no matter which other DLLs I call the function it only gets > initialized one time. > In short way, to use a singleton. > > I have debugged my code a lot, used purify...etc and I think the > problem is not in OpenSSL or my C code (is working under heavy > pressure in other programs),but in the extrange things with COM > apartments and threads, and I suppose this change in library would > not break compatibility much. > > It would be possible such a change or similar?.If you know another > solution I would like to hear... > > Thank you > > Pablo J. Royo > > -- Richard Levitte [EMAIL PROTECTED] ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]