diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:52:08 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2005-08-05 23:52:08 +0000 |
commit | 222f2246640d8bd00f509f47c436e8e48d4d67a9 (patch) | |
tree | dd8f7251ec1c20e5fd4fe14df1c35563889ce087 /ssl/s3_clnt.c | |
parent | 62b6cd007f5aee952acf52e087d535594b6eae15 (diff) |
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.
Diffstat (limited to 'ssl/s3_clnt.c')
-rw-r--r-- | ssl/s3_clnt.c | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/ssl/s3_clnt.c b/ssl/s3_clnt.c index 4f67cda042..51d4c48724 100644 --- a/ssl/s3_clnt.c +++ b/ssl/s3_clnt.c @@ -151,28 +151,10 @@ static SSL_METHOD *ssl3_get_client_method(int ver) return(NULL); } -SSL_METHOD *SSLv3_client_method(void) - { - static int init=1; - static SSL_METHOD SSLv3_client_data; - - if (init) - { - CRYPTO_w_lock(CRYPTO_LOCK_SSL_METHOD); - - if (init) - { - memcpy((char *)&SSLv3_client_data,(char *)sslv3_base_method(), - sizeof(SSL_METHOD)); - SSLv3_client_data.ssl_connect=ssl3_connect; - SSLv3_client_data.get_ssl_method=ssl3_get_client_method; - init=0; - } - - CRYPTO_w_unlock(CRYPTO_LOCK_SSL_METHOD); - } - return(&SSLv3_client_data); - } +IMPLEMENT_ssl3_meth_func(SSLv3_client_method, + ssl_undefined_function, + ssl3_connect, + ssl3_get_client_method) int ssl3_connect(SSL *s) { |