Initialize SSL_METHOD structures at compile time. This removes the need
for locking code. The CRYPTO_LOCK_SSL_METHOD lock is now no longer used.
This commit is contained in:
@@ -73,27 +73,8 @@ static SSL_METHOD *ssl23_get_method(int ver)
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
SSL_METHOD *SSLv23_method(void)
|
||||
{
|
||||
static int init=1;
|
||||
static SSL_METHOD SSLv23_data;
|
||||
|
||||
if (init)
|
||||
{
|
||||
CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD);
|
||||
|
||||
if (init)
|
||||
{
|
||||
memcpy((char *)&SSLv23_data,(char *)sslv23_base_method(),
|
||||
sizeof(SSL_METHOD));
|
||||
SSLv23_data.ssl_connect=ssl23_connect;
|
||||
SSLv23_data.ssl_accept=ssl23_accept;
|
||||
SSLv23_data.get_ssl_method=ssl23_get_method;
|
||||
init=0;
|
||||
}
|
||||
|
||||
CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD);
|
||||
}
|
||||
return(&SSLv23_data);
|
||||
}
|
||||
IMPLEMENT_ssl23_meth_func(SSLv23_method,
|
||||
ssl23_accept,
|
||||
ssl23_connect,
|
||||
ssl23_get_method)
|
||||
|
||||
|
Reference in New Issue
Block a user